How to know which processor I'm targetting at runtime

Andrew Cagney ac131313@redhat.com
Fri Feb 14 13:46:00 GMT 2003


> I have some ugly code that relies on a define from one of our
> config/arch/tm*.h files.  Essentially we're just doing:
> 
> #define SOLIB_PROCESSOR [x86|mips|arm....]
> 
> so that we can do some setup elsewhere.  Is there a nice way to get which
> architecture I'm running at runtime?  I'd like to get rid of our tm files if
> possible.

gdbarch_bfd_arch_info (current_gdbarch) returns a `struct bfd_arch_info' 
which contains everything you need.

Andrew




More information about the Gdb mailing list