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

Jack Howarth
2009-10-07T20:45:37Z

On Wed, Oct 07, 2009 at 11:09:39AM -0700, n179911 wrote:
> Hi,
>
> I have compiled gdb 7.0 on Mac OS X. And I have configured XCode to
> use this new version of gdb 7.0.
>
> But when I start debug my XCode project it said gdb can't recognize
> the option '--arch=i386'. Here is the log of my error:
>
> [Session started at 2009-10-07 11:00:43 -0700.]
> /Users/n179911/bin/gdb/bin/gdb: unrecognized option `--arch=i386'
> Use `/Users/n179911/bin/gdb/bin/gdb --help' for a complete list of options.
>
> The Debugger has exited with status 1.The Debugger has exited with status
>
> Can you please tell me how to build gdb to support '--arch-i386' option?
>
> Thank you.

You don't indicate if you are running Snow Leopard are not. The gdb 7.0
release uses the latest config.guess which detects the architecture as
that of the default code generation for the system compiler (which is
x86_64 on EMT64 capable hardware). If you want to build the 32-bit gdb
under those conditions, you should explicitly pass the triplet
i386-apple-darwin10 or i686-apple-darwin10 to configure for --host/--build/--target.
I would note that currently for the x86_64-apple-darwin10 build, the
resulting gdb doesn't load i386 binaires (unlike the situation under Linux).
I haven't tested the i686-apple-darwin9 build to see if it can load x86_64
binaries yet.
Jack