1

I am attempting to compile GDB 7.4 (the version that is on the gdb website) under Mac OSX and I receive the following error:

mach-o.c: In function 'bfd_mach_o_header_p': mach-o.c.2978: warning: 'header.reserved' may be used uninitialized in this function

While trying to figure out the cause of this problem I came across the following article:

http://www.puredarwin.org/blockers

which claims that the cause of this problem is that the normal version of gdb doesn't work on the Darwin OS (when I do ./configure the "system type" comes up as i386-apple-darwin9.8.0). Is this corret, and if so, where do I get the "Apple version" which does work on Mac OSX?

2 Answers 2

1

GDB developers certainly try to make FSF version of GDB work on Mac OSX.

But since none of them actively use Mac OSX, breakage creeps in.

You should report the build problem here.

Also, adding -Wno-error to your CFLAGS should get you past that first hurdle (though there could be many more ahead).

Sign up to request clarification or add additional context in comments.

Comments

0

Apple puts a lot of custom junk in gdb (or did, they're probably not going to spend a lot of time on it, instead focusing on lldb). So out-of-the-box gdb doesn't work on osx.

You can grab their junky old version of gdb from http://opensource.apple.com/

4 Comments

bah, who wants the old junky version?
someone who wants to debug stuff on osx?
i got gdb 7.5.1 to compile using homebrew under ML but was running into the code sign error 0x5 problem, so I ended up running gdb 7.5.1 with sudo :-/ ...not the best solution
gdb is kinda 'old style' from what I gather. You should now look for lldb from the llvm package. Which should be more closely related to the shipped XCode debugger since Apple has been directing a lot of effort to the llvm project and contributing. YMMV though, haven't tried it myself. But, lldm is the 'new hotness'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.