? ChangeLog.hppa
? gdb.diff
? gdb/hppanbsd-nat.c
? gdb/hppanbsd-tdep.c
? gdb/hppaobsd-tdep.c
? gdb/config/pa/nbsd.mh
Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.974
diff -u -p -u -r1.974 Makefile.in
--- gdb/Makefile.in 11 Jan 2008 13:34:14 -0000 1.974
+++ gdb/Makefile.in 19 Jan 2008 11:24:08 -0000
@@ -451,7 +451,8 @@ ALL_TARGET_OBS = \
cris-tdep.o \
frv-linux-tdep.o frv-tdep.o \
h8300-tdep.o \
- hppabsd-tdep.o hppa-hpux-tdep.o hppa-linux-tdep.o hppa-tdep.o \
+ hppabsd-tdep.o hppanbsd-tdep.o hppaobsd-tdep.o \
+ hppa-hpux-tdep.o hppa-linux-tdep.o hppa-tdep.o \
i386bsd-tdep.o i386-cygwin-tdep.o i386fbsd-tdep.o i386gnu-tdep.o \
i386-linux-tdep.o i386nbsd-tdep.o i386-nto-tdep.o i386obsd-tdep.o \
i386-sol2-tdep.o i386-tdep.o i387-tdep.o \
@@ -1541,6 +1542,8 @@ ALLDEPFILES = \
hppa-tdep.c hppa-hpux-tdep.c hppa-hpux-nat.c \
hppa-linux-tdep.c hppa-linux-nat.c \
hppabsd-nat.c hppabsd-tdep.c \
+ hppaobsd-tdep.c \
+ hppanbsd-nat.c hppanbsd-tdep.c \
i386-tdep.c i386-linux-nat.c \
i386v4-nat.c i386-cygwin-tdep.c \
i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c i386fbsd-tdep.c \
@@ -2165,11 +2168,16 @@ h8300-tdep.o: h8300-tdep.c $(defs_h) $(v
$(gdbcore_h) $(objfiles_h) $(gdb_assert_h) $(dis_asm_h) \
$(dwarf2_frame_h) $(frame_base_h) $(frame_unwind_h)
hppabsd-nat.o: hppabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
+ $(hppa_tdep_h) $(inf_ptrace_h)
+hppabsd-tdep.o: hppabsd-tdep.c $(defs_h) $(objfiles_h) $(target_h) \
+ $(value_h) $(elf_common_h) $(hppa_tdep_h) $(solib_svr4_h)
+hppanbsd-nat.o: hppabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
$(target_h) $(hppa_tdep_h) $(inf_ptrace_h)
-hppabsd-tdep.o: hppabsd-tdep.c $(defs_h) $(arch_utils_h) $(symtab_h) \
- $(objfiles_h) $(osabi_h) $(regcache_h) $(regset_h) $(target_h) \
- $(value_h) $(gdb_assert_h) $(gdb_string_h) $(elf_common_h) \
- $(hppa_tdep_h) $(solib_svr4_h) $(gdbtypes_h)
+hppanbsd-tdep.o: hppanbsd-tdep.c $(defs_h) $(osabi_h) $(regcache_h) $(regset_h) \
+ $(trad_frame_h) $(tramp_frame_h) $(gdb_assert_h) $(gdb_string_h) \
+ $(hppa_tdep_h)
+hppaobsd-tdep.o: hppaobsd-tdep.c $(defs_h) $(osabi_h) $(regcache_h) $(regset_h) \
+ $(gdb_assert_h) $(gdb_string_h) $(hppa_tdep_h)
hppa-hpux-nat.o: hppa-hpux-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
$(target_h) $(gdb_assert_h) $(hppa_tdep_h) $(inf_ptrace_h) \
$(inf_ttrace_h)
Index: gdb/NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.251
diff -u -p -u -r1.251 NEWS
--- gdb/NEWS 5 Jan 2008 21:50:43 -0000 1.251
+++ gdb/NEWS 19 Jan 2008 11:24:10 -0000
@@ -186,6 +186,7 @@ info spu
* New native configurations
OpenBSD/sh sh*-*openbsd*
+NetBSD/hppa hppa*-*netbsd*
set tdesc filename
unset tdesc filename
@@ -198,6 +199,7 @@ show tdesc filename
OpenBSD/sh sh*-*-openbsd*
MIPS64 GNU/Linux (gdbserver) mips64-linux-gnu
Toshiba Media Processor mep-elf
+NetBSD/hppa hppa*-*-netbsd*
* New remote packets
Index: gdb/configure.host
===================================================================
RCS file: /cvs/src/src/gdb/configure.host,v
retrieving revision 1.100
diff -u -p -u -r1.100 configure.host
--- gdb/configure.host 6 May 2007 23:04:26 -0000 1.100
+++ gdb/configure.host 19 Jan 2008 11:24:11 -0000
@@ -79,6 +79,7 @@ arm*-*-openbsd*) gdb_host=nbsdelf ;;
hppa*-*-hpux*)
gdb_host=hpux ;;
hppa*-*-linux*) gdb_host=linux ;;
+hppa*-*-netbsd*) gdb_host=nbsd ;;
hppa*-*-openbsd*) gdb_host=obsd ;;
i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu)
Index: gdb/configure.tgt
===================================================================
RCS file: /cvs/src/src/gdb/configure.tgt,v
retrieving revision 1.198
diff -u -p -u -r1.198 configure.tgt
--- gdb/configure.tgt 30 Dec 2007 22:13:55 -0000 1.198
+++ gdb/configure.tgt 19 Jan 2008 11:24:11 -0000
@@ -130,9 +130,14 @@ hppa*-*-linux*)
gdb_target_obs="hppa-tdep.o hppa-linux-tdep.o glibc-tdep.o \
solib.o solib-svr4.o symfile-mem.o"
;;
+hppa*-*-netbsd*)
+ # Target: NetBSD/hppa
+ gdb_target_obs="hppa-tdep.o hppabsd-tdep.o hppanbsd-tdep.o \
+ corelow.o solib.o solib-svr4.o"
+ ;;
hppa*-*-openbsd*)
# Target: OpenBSD/hppa
- gdb_target_obs="hppa-tdep.o hppabsd-tdep.o \
+ gdb_target_obs="hppa-tdep.o hppabsd-tdep.o hppaobsd-tdep.o \
corelow.o solib.o solib-svr4.o"
;;
hppa*-*-*)
Index: gdb/hppabsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppabsd-tdep.c,v
retrieving revision 1.11
diff -u -p -u -r1.11 hppabsd-tdep.c
--- gdb/hppabsd-tdep.c 1 Jan 2008 22:53:10 -0000 1.11
+++ gdb/hppabsd-tdep.c 19 Jan 2008 11:24:11 -0000
@@ -18,79 +18,15 @@
along with this program. If not, see . */
#include "defs.h"
-#include "arch-utils.h"
-#include "gdbtypes.h"
-#include "symtab.h"
#include "objfiles.h"
-#include "osabi.h"
-#include "regcache.h"
-#include "regset.h"
#include "target.h"
#include "value.h"
-#include "gdb_assert.h"
-#include "gdb_string.h"
-
#include "elf/common.h"
#include "hppa-tdep.h"
#include "solib-svr4.h"
-/* Core file support. */
-
-/* Sizeof `struct reg' in . */
-#define HPPABSD_SIZEOF_GREGS (34 * 4)
-
-/* Supply register REGNUM from the buffer specified by GREGS and LEN
- in the general-purpose register set REGSET to register cache
- REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
-
-static void
-hppabsd_supply_gregset (const struct regset *regset, struct regcache *regcache,
- int regnum, const void *gregs, size_t len)
-{
- const gdb_byte *regs = gregs;
- size_t offset;
- int i;
-
- gdb_assert (len >= HPPABSD_SIZEOF_GREGS);
-
- for (i = HPPA_R1_REGNUM, offset = 4; i <= HPPA_R31_REGNUM; i++, offset += 4)
- {
- if (regnum == -1 || regnum == i)
- regcache_raw_supply (regcache, i, regs + offset);
- }
-
- if (regnum == -1 || regnum == HPPA_SAR_REGNUM)
- regcache_raw_supply (regcache, HPPA_SAR_REGNUM, regs);
- if (regnum == -1 || regnum == HPPA_PCOQ_HEAD_REGNUM)
- regcache_raw_supply (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 32 * 4);
- if (regnum == -1 || regnum == HPPA_PCOQ_TAIL_REGNUM)
- regcache_raw_supply (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 33 * 4);
-}
-
-/* OpenBSD/hppa register set. */
-
-static struct regset hppabsd_gregset =
-{
- NULL,
- hppabsd_supply_gregset
-};
-
-/* Return the appropriate register set for the core section identified
- by SECT_NAME and SECT_SIZE. */
-
-static const struct regset *
-hppabsd_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name, size_t sect_size)
-{
- if (strcmp (sect_name, ".reg") == 0 && sect_size >= HPPABSD_SIZEOF_GREGS)
- return &hppabsd_gregset;
-
- return NULL;
-}
-
-
CORE_ADDR
hppabsd_find_global_pointer (struct value *function)
{
@@ -143,11 +79,12 @@ hppabsd_find_global_pointer (struct valu
if (target_read_memory (addr + 4, buf, sizeof buf) != 0)
break;
- /* The OpenBSD ld.so doesn't relocate DT_PLTGOT, so
+ /* The NetBSD/OpenBSD ld.so doesn't relocate DT_PLTGOT, so
we have to do it ourselves. */
pltgot = extract_unsigned_integer (buf, sizeof buf);
pltgot += ANOFFSET (sec->objfile->section_offsets,
SECT_OFF_TEXT (sec->objfile));
+
return pltgot;
}
@@ -163,7 +100,7 @@ hppabsd_find_global_pointer (struct valu
}
-static void
+void
hppabsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -172,10 +109,6 @@ hppabsd_init_abi (struct gdbarch_info in
set_gdbarch_long_double_bit (gdbarch, 64);
set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double);
- /* Core file support. */
- set_gdbarch_regset_from_core_section
- (gdbarch, hppabsd_regset_from_core_section);
-
/* OpenBSD and NetBSD use ELF. */
tdep->is_elf = 1;
tdep->find_global_pointer = hppabsd_find_global_pointer;
@@ -186,34 +119,3 @@ hppabsd_init_abi (struct gdbarch_info in
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
}
-
-
-/* OpenBSD uses uses the traditional NetBSD core file format, even for
- ports that use ELF. */
-#define GDB_OSABI_NETBSD_CORE GDB_OSABI_OPENBSD_ELF
-
-static enum gdb_osabi
-hppabsd_core_osabi_sniffer (bfd *abfd)
-{
- if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
- return GDB_OSABI_NETBSD_CORE;
-
- return GDB_OSABI_UNKNOWN;
-}
-
-
-/* Provide a prototype to silence -Wmissing-prototypes. */
-void _initialize_hppabsd_tdep (void);
-
-void
-_initialize_hppabsd_tdep (void)
-{
- /* BFD doesn't set a flavour for NetBSD style a.out core files. */
- gdbarch_register_osabi_sniffer (bfd_arch_hppa, bfd_target_unknown_flavour,
- hppabsd_core_osabi_sniffer);
-
- gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_NETBSD_ELF,
- hppabsd_init_abi);
- gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_OPENBSD_ELF,
- hppabsd_init_abi);
-}