This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[hpux] 64-bit corefile support
- From: Randolph Chung <randolph at tausq dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 09 Dec 2005 19:26:12 +0800
- Subject: [hpux] 64-bit corefile support
Based on Mark's earlier feedback and his patch to bfd, I've committed
the following.
randolph
2005-12-09 Randolph Chung <tausq@debian.org>
* hppa-hpux-tdep.c (hppa_hpux_core_osabi_sniffer): Check for HPUX ELF
core files.
(_initialize_hppa_hpux_tdep): Install sniffer for ELF core files.
* config/pa/hpux.mh: Compile corelow.o.
Index: hppa-hpux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v
retrieving revision 1.45
diff -u -p -r1.45 hppa-hpux-tdep.c
--- hppa-hpux-tdep.c 19 Nov 2005 12:55:55 -0000 1.45
+++ hppa-hpux-tdep.c 9 Dec 2005 11:19:16 -0000
@@ -2064,6 +2064,24 @@ hppa_hpux_core_osabi_sniffer (bfd *abfd)
{
if (strcmp (bfd_get_target (abfd), "hpux-core") == 0)
return GDB_OSABI_HPUX_SOM;
+ else if (strcmp (bfd_get_target (abfd), "elf64-hppa") == 0)
+ {
+ asection *section;
+
+ section = bfd_get_section_by_name (abfd, ".kernel");
+ if (section)
+ {
+ bfd_size_type size;
+ char *contents;
+
+ size = bfd_section_size (abfd, section);
+ contents = alloca (size);
+ if (bfd_get_section_contents (abfd, section, contents,
+ (file_ptr) 0, size)
+ && strcmp (contents, "HP-UX") == 0)
+ return GDB_OSABI_HPUX_ELF;
+ }
+ }
return GDB_OSABI_UNKNOWN;
}
@@ -2076,6 +2094,9 @@ _initialize_hppa_hpux_tdep (void)
gdbarch_register_osabi_sniffer (bfd_arch_unknown,
bfd_target_unknown_flavour,
hppa_hpux_core_osabi_sniffer);
+ gdbarch_register_osabi_sniffer (bfd_arch_hppa,
+ bfd_target_elf_flavour,
+ hppa_hpux_core_osabi_sniffer);
gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_HPUX_SOM,
hppa_hpux_som_init_abi);
Index: config/pa/hpux.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hpux.mh,v
retrieving revision 1.3
diff -u -p -r1.3 hpux.mh
--- config/pa/hpux.mh 13 Dec 2004 04:06:16 -0000 1.3
+++ config/pa/hpux.mh 9 Dec 2005 11:19:16 -0000
@@ -1,3 +1,3 @@
# Host: PA-RISC HP-UX
NATDEPFILES= fork-child.o inf-ptrace.o inf-ttrace.o \
- hppa-hpux-nat.o
+ hppa-hpux-nat.o corelow.o