aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2006-07-09 22:01:59 +0000
committerMark Kettenis <kettenis@gnu.org>2006-07-09 22:01:59 +0000
commitb0ca85736544b15d99386b9da5d39586a4c5eb97 (patch)
treecbf14efb0f5f388c9ac8948fff895361602486ba /gdb
parent3b03cc436125ee5a53661fa21416f0d63ab042db (diff)
downloadgdb-b0ca85736544b15d99386b9da5d39586a4c5eb97.zip
gdb-b0ca85736544b15d99386b9da5d39586a4c5eb97.tar.gz
gdb-b0ca85736544b15d99386b9da5d39586a4c5eb97.tar.bz2
* alphabsd-tdep.h (alphanbsd_regset_from_core_section): New
prototype. * alphanbsd-tdep.c (alphanbsd_regset_from_core_section): Handle a.out-style core file format here. Make global. (alphanbsd_regset_from_core_section): Remove. (alphanbsd_sigtramp_offset): Make static. (alphanbsd_aout_init_abi): Remove. (alphanbsd_core_osabi_sniffer): Return GDB_OSABI_NETBSD_ELF for a.out style core files. (_initialize_alphanbsd_tdep): Do not register a handler for GDB_OSABI_NETBSD_AOUT.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/alphabsd-tdep.h9
-rw-r--r--gdb/alphanbsd-tdep.c39
3 files changed, 32 insertions, 28 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c666534..a9aab62 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,17 @@
2006-07-09 Mark Kettenis <kettenis@gnu.org>
+ * alphabsd-tdep.h (alphanbsd_regset_from_core_section): New
+ prototype.
+ * alphanbsd-tdep.c (alphanbsd_regset_from_core_section): Handle
+ a.out-style core file format here. Make global.
+ (alphanbsd_regset_from_core_section): Remove.
+ (alphanbsd_sigtramp_offset): Make static.
+ (alphanbsd_aout_init_abi): Remove.
+ (alphanbsd_core_osabi_sniffer): Return GDB_OSABI_NETBSD_ELF for
+ a.out style core files.
+ (_initialize_alphanbsd_tdep): Do not register a handler for
+ GDB_OSABI_NETBSD_AOUT.
+
* alphabsd-tdep.h: Tweak comments.
(SIZEOF_STRUCT_REG, SIZEOF_STRUCT_FPREG): Remove.
* alphanbsd-tdep.c: Reorder includes. Include "regset.h".
diff --git a/gdb/alphabsd-tdep.h b/gdb/alphabsd-tdep.h
index e434895..9d74945 100644
--- a/gdb/alphabsd-tdep.h
+++ b/gdb/alphabsd-tdep.h
@@ -27,5 +27,14 @@ void alphabsd_fill_reg (char *, int);
void alphabsd_supply_fpreg (char *, int);
void alphabsd_fill_fpreg (char *, int);
+
+
+/* Functions exported from alphanbsd-tdep.c. */
+
+/* Return the appropriate register set for the core section identified
+ by SECT_NAME and SECT_SIZE. */
+extern const struct regset *
+ alphanbsd_regset_from_core_section (struct gdbarch *gdbarch,
+ const char *sect_name, size_t len);
#endif /* alphabsd-tdep.h */
diff --git a/gdb/alphanbsd-tdep.c b/gdb/alphanbsd-tdep.c
index ca1ecff..44f1145 100644
--- a/gdb/alphanbsd-tdep.c
+++ b/gdb/alphanbsd-tdep.c
@@ -163,29 +163,23 @@ static struct regset alphanbsd_aout_gregset =
/* Return the appropriate register set for the core section identified
by SECT_NAME and SECT_SIZE. */
-static const struct regset *
+const struct regset *
alphanbsd_regset_from_core_section (struct gdbarch *gdbarch,
const char *sect_name, size_t sect_size)
{
if (strcmp (sect_name, ".reg") == 0 && sect_size >= ALPHANBSD_SIZEOF_GREGS)
- return &alphanbsd_gregset;
+ {
+ if (sect_size >= ALPHANBSD_SIZEOF_GREGS + ALPHANBSD_SIZEOF_FPREGS)
+ return &alphanbsd_aout_gregset;
+ else
+ return &alphanbsd_gregset;
+ }
if (strcmp (sect_name, ".reg2") == 0 && sect_size >= ALPHANBSD_SIZEOF_FPREGS)
return &alphanbsd_fpregset;
return NULL;
}
-
-static const struct regset *
-alphanbsd_aout_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name,
- size_t sect_size)
-{
- if (strcmp (sect_name, ".reg") == 0 && sect_size >= ALPHANBSD_SIZEOF_GREGS)
- return &alphanbsd_aout_gregset;
-
- return NULL;
-}
/* Signal trampolines. */
@@ -216,7 +210,7 @@ static const unsigned char sigtramp_retcode[] =
#define RETCODE_NWORDS 4
#define RETCODE_SIZE (RETCODE_NWORDS * 4)
-LONGEST
+static LONGEST
alphanbsd_sigtramp_offset (CORE_ADDR pc)
{
unsigned char ret[RETCODE_SIZE], w[4];
@@ -261,6 +255,7 @@ alphanbsd_sigcontext_addr (struct frame_info *frame)
out which trampoline frame type we have. */
return get_frame_base (frame);
}
+
static void
alphanbsd_init_abi (struct gdbarch_info info,
@@ -292,23 +287,13 @@ alphanbsd_init_abi (struct gdbarch_info info,
set_gdbarch_regset_from_core_section
(gdbarch, alphanbsd_regset_from_core_section);
}
-
-static void
-alphanbsd_aout_init_abi (struct gdbarch_info info,
- struct gdbarch *gdbarch)
-{
- alphanbsd_init_abi(info, gdbarch);
-
- set_gdbarch_regset_from_core_section
- (gdbarch, alphanbsd_aout_regset_from_core_section);
-}
static enum gdb_osabi
alphanbsd_core_osabi_sniffer (bfd *abfd)
{
if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
- return GDB_OSABI_NETBSD_AOUT;
+ return GDB_OSABI_NETBSD_ELF;
return GDB_OSABI_UNKNOWN;
}
@@ -326,8 +311,6 @@ _initialize_alphanbsd_tdep (void)
gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD_ELF,
alphanbsd_init_abi);
- gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD_AOUT,
- alphanbsd_aout_init_abi);
gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OPENBSD_ELF,
- alphanbsd_aout_init_abi);
+ alphanbsd_init_abi);
}