Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
466 views
in Technique[技术] by (71.8m points)

gdb fails on mountain lion

I tried to compile a 7.x Version of gdb without any luck. I codesigned the executable(http://sourceware.org/gdb/wiki/BuildingOnDarwin).

With following version there were these problems.

7.5,7.4,git clone: unknown load command 0x2a (and others) for my application and different system libraries when starting gbd. When trying to print a vector for example i always get: Could not find the frame base for "main(int, char**)"

7.3 (macports and from gdb-website): on starting the application it fails to set the breakpoint and continues to run.

(gdb) start
Temporary breakpoint 1 at 0x100000950: file ../src/main.cpp, line 15.
Starting program: [...]
BFD: unable to read unknown load command 0x24
BFD: unable to read unknown load command 0x2a
BFD: unable to read unknown load command 0x26
Error in re-setting breakpoint 1: Cannot access memory at address 0x100000950
[application continues]

I used the system llvm-gcc, gcc4.7 and svn-gcc4.8 to compile. Has anybody succeeded in installing gdb on Mountain Lion?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

i installed gdb 7.5 on mountain lion without problems...

  1. those steps might help you: ./configure --prefix=/usr/local --enable-targets=x86_64-apple-darwin10 --enable-64-bit-bfd --disable-werror --build=x86_64-apple-darwin10 --host=x86_64-apple-darwin10 --target=x86_64-apple-darwin10

  2. then make install gdb.

  3. create your own certificate like discribed here and sign the gdb http://sourceware.org/gdb/wiki/BuildingOnDarwin

  4. you have to explicitly state: codesign -s gdb-cert /usr/local/gdb before you sign the gdb make sure you already set your certificate to trusted. also close the keychain before signing your gdb.

hope this also works for your


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...