RFA: AIX 64-bit mega-patch
Wed Jun 14 04:49:00 GMT 2000
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
>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)
> 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
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.
More information about the Gdb-patches