How to setup/using GDB 7 on MacOS Lion with MacPorts - debugging

I run into trouble using GDB 7 (7.3) on MacOS Lion.
What I did was:
$ sudo port install gdb
After that GDB was installed to: /opt/local/bin/ggdb
But when I try to execute GDB I always receive the following at start:
BFD: unable to read unknown load command 0x24
BFD: unable to read unknown load command 0x26
BFD: unable to read unknown load command 0x24
BFD: unable to read unknown load command 0x26
Further it tells me:
Reading symbols from ... done.
but when I try to get for example a backtrace via 'bt' I only see unresolved function adresses. I tried to set the LIBRARY_PATH inside my application folder.
$ export DYLD_LIBRARY_PATH=`pwd`
but without success. The problems remain.
Using the default GDB 6.3 which is provided with Lion/Xcode works fine.
Thanks in advance for any advice.

Try cgdb for now, it's actually pretty nice so far:
sudo port install cgdb
I don't claim to understand why the latest gdb sources have an issue on the mac, but I have the same issue as you and I tried cgdb and it works for me. Links for more information:
http://cgdb.sourceforge.net/
https://trac.macports.org/ticket/26450

On Maverick follow this instructions that use homebrew. It seems that Apple's new system makes it hard to use gdb...
http://ntraft.com/installing-gdb-on-os-x-mavericks/

Related

How do I fix `ld: unexpected token: !tapi-tbd-v3 file` with gfortran on my Mac?

I keep getting this error whenever I try and compile a .f90 file on my Mac Mojave (10.14)
collect2: fatal error: ld terminated with signal 11 [Segmentation fault: 11]
compilation terminated.
ld: unexpected token: !tapi-tbd-v3 file
'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64
I've tried uninstalling Xcode and command line tools multiple times as well as created a symlink to the *tbd file so it doesn't require the tbd files anymore. I've also tried deleting gfortran from my laptop and reinstalling it again but it's still not working.
I don't really know how to go about fixing this problem and I'm also a beginner at this compiler/linker topic. Any help would be greatly appreciated.
In case you installed gfortran via MacPorts, please uninstall it and install the xcode variant of the ld64 port:
sudo port install ld64 +ld64_xcode
After this, install gcc (version N) with -s to build it on your local machine:
sudo port install libgcc<N> libgcc
sudo port install -s gcc<N>
Unfortunately, I'm not familiar with solutions not using MacPorts.
After installing macports, the below 2 commands worked for me
sudo port -f activate ld64
sudo port install ld64 +ld64_xcode

How can I correctly install Bochs on OSX Sierra v10.13.4?

The path I took was using sh .conf.macos. After that, I tried sudo make and I get an error
../bochs.h:75:12: fatal error: 'types.h' file not found
#include <types.h>
using ./configure didn't help much because when I would make, I get a whole bunch of errors generated from carbon.cc. If I understand correctly, carbon.cc is deprecated but how do I deal with this?
I've tried this with both Bochs 2.6.8 and the latest SVN dated April 2, 2018.
I had similar problems while compiling bochs on MacOs. I saw lots of header not found problems. I tried with brew and it works.
Please use:
brew install bochs

Having trouble running the jos kernel of mit 6.828

OS: ubuntu-17.10-amd64
It seems that the building process succeed but the kernel failed running in qemu.
I have tried to investigate the problem here, but failed. Somehow I managed to fix it by building a i386-elf-gcc toolchain by myself and use that instead of gcc-multilib. Then it works properly.
I am using macOS, so I used this:
$ brew tap nativeos/i386-elf-toolchain
$ brew install i386-elf-gcc --verbose
Then I replaced all "i386-jos-elf" with "i386-elf" in GNUmakefile.

Linux kernel source not configured - missing > version.h. when intall a driver

I'm trying to install a intel e1000 ethernet card driver on ubuntu 12.04 LTS.
When i type
make install
The following error occur:
Makefile:111: * Linux kernel source not configured - missing
version.h. Stop.
in the README file thy say:
When trying to compile the driver by running make install, the
following error may occur:
"Linux kernel source not configured - missing version.h"
To solve this issue, create the version.h file by going to the Linux
source tree and entering:
make include/linux/version.h.
I try to run this command in the /usr/src/linux******* folder but no results
(
i have linux-headers-3.8.0-29 linux-headers-3.8.0-32
linux-headers-3.8.0-29-generic linux-headers-3.8.0-32-generic
)
any suggestions to fix the problem?
Some people just like to compile. Searching this error pointed me here.
As it turns out the compiler is looking at the wrong kernel version, and the headers for this are not installed on the OS.
Best solved editing the specfile.
Install build-essential using terminal or synaptic.
Restart computer, it will work.
Thank you.

gdb 7 segfaulting

I installed gdb 7.2 via macports on osx 10.6. However when I run it, I get
unable to read unknown load command 0x1a
Segmentation fault
I also tried compiling it manually but I still get the same error.
Any help would be greatly appreciated,
Thanks,
--Sid
Try these:
sudo chgrp procmod /opt/local/bin/fsf-gdb
sudo chmod g+s /opt/local/bin/fsf-gdb
Of course change "/opt/local/bin/" to reflect your path to gbd and change "fsf-gdb" to the name of the compiled gdb. I assumed "standard" path and name given by macports.
GDB is not actively maintained on Mac OS. Your best bet is to open a bug in GDB bugzilla.

Resources