diff options
author | Mark Kettenis <kettenis@gnu.org> | 2002-06-15 18:49:52 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2002-06-15 18:49:52 +0000 |
commit | b9f19d9fd31ef49e08a321605b079592f3f92b56 (patch) | |
tree | e1cf13123f2a01d39f6034683fabd4fca6d90343 /gdb | |
parent | e334692242522ff8a83a8edab56813c3fc441a9a (diff) | |
download | gdb-b9f19d9fd31ef49e08a321605b079592f3f92b56.tar.gz |
* i386-sol2-tdep.c (i386_sol2_osabi_sniffer): New function.
(_initialize_i386_sol2_tdep): Register i386_sol2_osabi_sniffer.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/i386-sol2-tdep.c | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 987c8856eea..726e41537b4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-06-15 Mark Kettenis <kettenis@gnu.org> + + * i386-sol2-tdep.c (i386_sol2_osabi_sniffer): New function. + (_initialize_i386_sol2_tdep): Register i386_sol2_osabi_sniffer. + 2002-06-15 Andrew Cagney <ac131313@redhat.com> * defs.h (auto_boolean): Declare enum. diff --git a/gdb/i386-sol2-tdep.c b/gdb/i386-sol2-tdep.c index 714f5db9b36..206e85cfe72 100644 --- a/gdb/i386-sol2-tdep.c +++ b/gdb/i386-sol2-tdep.c @@ -48,12 +48,27 @@ i386_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) } +static enum gdb_osabi +i386_sol2_osabi_sniffer (bfd *abfd) +{ + /* If we have a section named .SUNW_version, then it is almost + certainly Solaris 2. */ + if (bfd_get_section_by_name (abfd, ".SUNW_version")) + return GDB_OSABI_SOLARIS; + + return GDB_OSABI_UNKNOWN; +} + /* Provide a prototype to silence -Wmissing-prototypes. */ void _initialize_i386_sol2_tdep (void); void _initialize_i386_sol2_tdep (void) { + /* Register and ELF OS ABI sniffer for Solaris 2 binaries. */ + gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, + i386_sol2_osabi_sniffer); + gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_SOLARIS, i386_sol2_init_abi); } |