diff options
author | Joel Brobecker <brobecker@gnat.com> | 2002-12-02 23:30:34 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2002-12-02 23:30:34 +0000 |
commit | 41d1ea0d0b3f5cae8cf17a0b472078d7cacc6dc2 (patch) | |
tree | 947a9f1a2fd689c6cddfeeaff0f41c5652abfdf2 /gdb/hppa-tdep.c | |
parent | c99d909392d4b8df25da399b7eb41f9fa0474c8e (diff) | |
download | gdb-41d1ea0d0b3f5cae8cf17a0b472078d7cacc6dc2.tar.gz |
* hppa-tdep.c: Add #include "osabi.h" (for hppa_gdbarch_init).
(hppa_gdbarch_init): Detect osabi from objfile. Will be needed
later to set the proper gdbarch methods depending on the osabi.
* Makefile.in (hppa-tdep.o): Add dependency on osabi.h.
Diffstat (limited to 'gdb/hppa-tdep.c')
-rw-r--r-- | gdb/hppa-tdep.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 9d90312f1fb..2ea79064281 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -31,6 +31,7 @@ #include "regcache.h" #include "completer.h" #include "language.h" +#include "osabi.h" /* For argument passing to the inferior */ #include "symtab.h" @@ -4895,6 +4896,20 @@ static struct gdbarch * hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch *gdbarch; + enum gdb_osabi osabi = GDB_OSABI_UNKNOWN; + + /* Try to determine the ABI of the object we are loading. */ + + if (info.abfd != NULL) + { + osabi = gdbarch_lookup_osabi (info.abfd); + if (osabi == GDB_OSABI_UNKNOWN) + { + /* If it's a SOM file, assume it's HP/UX SOM. */ + if (bfd_get_flavour (info.abfd) == bfd_target_som_flavour) + osabi = GDB_OSABI_HPUX_SOM; + } + } /* find a candidate among the list of pre-declared architectures. */ arches = gdbarch_list_lookup_by_info (arches, &info); |