Identifying PowerPC architecture

Michael Eager eager@eagercon.com
Thu Jan 11 21:04:00 GMT 2007


Daniel Jacobowitz wrote:
> On Thu, Jan 11, 2007 at 12:46:55PM -0800, Michael Eager wrote:
>> I'm looking at how gdb decides which arch/mach it is
>> working with for PowerPC.  It looks like it always picks up
>> rs6000:6000 as processor type.
>>
>> When rs6000_gdbarch_init(struct gdbarch_info info,
>> struct gdbarch_list *arches) is called, arches is NULL.
>> As a result, it creates up a default arch/mach based on
>> info.bfd_arch_info.
> 
> ->arches is a list of previously initialized gdbarches.  They're
> initialized by other calls to rs6000_gdbarch_init.

I don't see where that happens, but I'll take your word.

> gdbarch_list_lookup_by_info will only return something with the
> same bfd_arch_info as it is passed.
> 
> So, if you're not getting the right arch, you're probably not
> starting with the right bfd_arch_info.  I don't know if PowerPC
> tags binaries with the processor; I don't remember any such markings
> for PowerPC.

Nope, there's no model info for PowerPC in the ELF file.

-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077



More information about the Gdb mailing list