This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: RFA: AIX 64-bit mega-patch
- To: ac131313 at cygnus dot com
- Subject: Re: RFA: AIX 64-bit mega-patch
- From: Nick Duffek <nsd at redhat dot com>
- Date: Wed, 14 Jun 2000 07:52:27 -0400
- CC: gdb-patches at sourceware dot cygnus dot com
- References: <3946D9D3.3761CC32@cygnus.com>
On 14-Jun-2000, Andrew Cagney wrote:
>Hmm, thats an interesting one. Not thought of it.
Geoff Keating mentioned it to me a few weeks ago.
>An immediate technical problem is that GDB doesn't know how to ask the
>target what the current ISA/ABI is.
In the AIX multi-arch port, I set TARGET_CREATE_INFERIOR_HOOK to
rs6000_create_inferior(), which is a function in rs6000-tdep.c that calls
rs6000_set_host_arch_hook() if it's non-null. rs6000-nat.c sets
rs6000_set_host_arch_hook() to static function set_host_arch(), which uses
AIX-specific calls to discover the current architecture.
That approach is correct, I think, but it's a bit convoluted; it might be
simpler for fork_inferior() to call something like
set_gdbarch_from_target().
>I can think of several possible behavours:
> o if the user entered ``set arch''
> then well, the user is always right
> (this is the easy one)
Yes, agreed.
> o if the user hasn't entered ``set arch''
> (ie ``set arch auto'') then:
>
> o silently stick with the object file
>
> o silently switch
>
> o verbose versions of the above
Or:
o always stick with the current "process" (core file
or inferior) if there is one, and default to the
current target's process characteristics otherwise.
That follows the principle of least surprise for typical GDB usage of
loading an object file via the command line and then running it: the user
isn't surprised by a switch to a new architecture.
Nick