Re: How to configure gdb to support '--arch=i386' on Mac OS X

Tristan Gingold
2009-10-08T07:54:56Z

On Oct 7, 2009, at 11:22 PM, Stan Shebs wrote:

> Michael Snyder wrote:
>> Yeahhhh, this isn't going to work.
>>
>> Your binary is in... I forget what it's called -- oh, "mach-o"
>> format.
>> Our (fsf) gdb does not know how to read that file format. And it
>> would be a huge job to port over the changes in apple gdb that tell
>> it how to read mach-o files (besides the fact that they are "fat"
>> files, or at least potentially might be). m
> The Mach-O part does work in 7.0, thanks to Tristan and AdaCore
> (check out gdb/machoread.c). I don't think fatness-handling is
> there, although at the Xcode level one has to specifically ask for
> fat builds anyway, so one could avoid that particular obstacle and
> thus be well-positioned to smack one's face into the next wall. :-)

Right. The work-around is not to build fat binaries.

Current FSF gdb can't handle fat executable. I am not sure that we
want to implement this, but feel free
to ask. However gdb handles fat objects such as dylibs.

Tristan.