Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » GDB 7.7.1 with llvm-gcc 5.1 on Mac
GDB 7.7.1 with llvm-gcc 5.1 on Mac [message #1403654] Thu, 24 July 2014 22:10 Go to next message
Doug Gaff is currently offline Doug GaffFriend
Messages: 1
Registered: July 2014
Junior Member
As you know, OS X Mavericks doesn't include GDB or GCC. I've installed GDB with homebrew and signed it as described here:

ntraft.com/installing-gdb-on-os-x-mavericks/

Building a simple HelloWorld.c app from a makefile using XCode's llvm-gcc works fine, but trying to debug it with GDB 7.7.1 is flaky.

In CDT, sometimes it correctly stops on main, but then it flakes out while stepping. Trying it from the command line produces similar results. Doing an attach on the process and trying to set a breakpoint returns this:

Attaching to process 29997
Reading symbols from /Users/dgaff/Documents/Code/ss.com/svn/video/doug/doug...Reading symbols from /Users/dgaff/Documents/Code/ss.com/svn/video/doug/doug.dSYM/Contents/Resources/DWARF/doug...done.
done.
0x000000010f96af4e in ?? ()
(gdb) break myfunc
Cannot access memory at address 0x100000f40

It looks like a symbol issue. Here's the build command:

gcc -g3 -gdwarf-2 doug.c -o doug

Running Xcode's lldb from the command line to debug it works fine.
Re: GDB 7.7.1 with llvm-gcc 5.1 on Mac [message #1403902 is a reply to message #1403654] Mon, 28 July 2014 14:08 Go to previous messageGo to next message
Doug Schaefer is currently offline Doug SchaeferFriend
Messages: 135
Registered: July 2009
Senior Member
Hey Doug, that usually points to gdb loading the wrong or bad symbols, i.e. has the wrong address info for myfunc. I wonder about the -gdwarf-2 entry. You might want to just let it use the default.
Re: GDB 7.7.1 with llvm-gcc 5.1 on Mac [message #1403957 is a reply to message #1403902] Mon, 28 July 2014 17:40 Go to previous message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
Sometimes the message "Cannot access memory at address..." is due to the fact that the process is currently running.
Before trying to set a breakpoint, try typing
interrupt
and then see if you can set a breakpoint.

I'm not sure what is happening when CDT does it, as the traces above seem to be from a manual command.

Marc
Previous Topic:Luna Subversive installation problem
Next Topic:Hybrid C/Fortran code
Goto Forum:
  


Current Time: Wed Oct 09 16:19:35 GMT 2024

Powered by FUDForum. Page generated in 0.03112 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top