]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* hppa-tdep.c: Add #include "osabi.h" (for hppa_gdbarch_init).
authorJoel Brobecker <brobecker@gnat.com>
Mon, 2 Dec 2002 23:30:34 +0000 (23:30 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Mon, 2 Dec 2002 23:30:34 +0000 (23:30 +0000)
       (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.

gdb/ChangeLog
gdb/Makefile.in
gdb/hppa-tdep.c

index b22a8651e419b101acc9358d2e318bf798eae28d..378db56eb5117e2ad22f5787aa049856315f72a7 100644 (file)
@@ -1,3 +1,10 @@
+2002-12-02  J. Brobecker  <brobecker@gnat.com>
+
+       * 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.
+
 2002-12-02  J. Brobecker  <brobecker@gnat.com>
 
        * osabi.h (gdb_osabi): Add two new enum values for HPUX ELF and SOM.
index c9d65c8fa319ff85f5db346c7a1d96229aedce6a..9c0d6e58caaef0dc6cc51e05e4b006fc6419dbfa 100644 (file)
@@ -1749,7 +1749,7 @@ hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \
 hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \
        $(value_h) $(regcache_h) $(completer_h) $(symtab_h) $(a_out_encap_h) \
        $(gdb_stat_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) \
-       $(symfile_h) $(objfiles_h) $(language_h)
+       $(symfile_h) $(objfiles_h) $(language_h) $(osabi_h)
 hppab-nat.o: hppab-nat.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h)
 hppah-nat.o: hppah-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
        $(gdb_wait_h) $(regcache_h)
index 9d90312f1fb83733e1d88b736c9263c83874c2d1..2ea79064281e7d83d2bb6c18b5de62628c4b6bd1 100644 (file)
@@ -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);