+2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ * amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Remove.
+ (amd64obsd_iterate_over_regset_sections): New.
+ (amd64obsd_core_init_abi): Adjust gdbarch initialization.
+ * i386-cygwin-tdep.c (i386_windows_regset_from_core_section):
+ Remove.
+ (i386_cygwin_init_abi): Clear tdep->sizeof_fpregset. Drop
+ regset_from_core_section initialization.
+ * i386-tdep.c (i386_regset_from_core_section): Remove.
+ (i386_iterate_over_regset_sections): New.
+ (i386_gdbarch_init): Adjust gdbarch initialization.
+ * i386-tdep.h (i386_regset_from_core_section): Remove prototype.
+ (i386_iterate_over_regset_sections): New prototype.
+ * i386obsd-tdep.c (i386obsd_aout_regset_from_core_section):
+ Remove.
+ (i386obsd_aout_iterate_over_regset_sections): New.
+ (i386obsd_aout_init_abi): Adjust gdbarch initialization.
+ * configure.tgt (gdb_target_obs): Add fbsd-tdep.o for all x86 FreeBSD
+ targets.
+ * amd64fbsd-tdep.c (fbsd-tdep.h): Include.
+ (amd64fbsd_init_abi): Call fbsd_init_abi.
+ * i386fbsd-tdep.c (fbsd-tdep.h): Include.
+ (i386fbsd4_init_abi): Call fbsd_init_abi.
+ * amd64fbsd-nat.c (_initialize_amd64fbsd_nat): No longer set
+ target method 'make_corefile_notes'.
+ * i386fbsd-nat.c (_initialize_i386fbsd_nat): Likewise.
+
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* hppa-hpux-tdep.c (hppa_hpux_regset_from_core_section): Remove.
t->to_pid_to_exec_file = fbsd_pid_to_exec_file;
t->to_find_memory_regions = fbsd_find_memory_regions;
- t->to_make_corefile_notes = fbsd_make_corefile_notes;
add_target (t);
/* Support debugging kernel virtual memory images. */
#include "amd64-tdep.h"
#include "bsd-uthread.h"
+#include "fbsd-tdep.h"
#include "solib-svr4.h"
/* Support for signal handlers. */
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ /* Generic FreeBSD support. */
+ fbsd_init_abi (info, gdbarch);
+
/* Obviously FreeBSD is BSD-based. */
i386bsd_init_abi (info, gdbarch);
NULL, amd64obsd_supply_regset, NULL
};
-static const struct regset *
-amd64obsd_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name, size_t sect_size)
+static void
+amd64obsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ iterate_over_regset_sections_cb *cb,
+ void *cb_data,
+ const struct regcache *regcache)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* OpenBSD core dumps don't use seperate register sets for the
general-purpose and floating-point registers. */
- if (strcmp (sect_name, ".reg") == 0
- && sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE)
- return &amd64obsd_combined_regset;
-
- return NULL;
+ cb (".reg", tdep->sizeof_gregset + I387_SIZEOF_FXSAVE,
+ &amd64obsd_combined_regset, NULL, cb_data);
}
\f
{
amd64obsd_init_abi (info, gdbarch);
- set_gdbarch_regset_from_core_section
- (gdbarch, amd64obsd_regset_from_core_section);
+ set_gdbarch_iterate_over_regset_sections
+ (gdbarch, amd64obsd_iterate_over_regset_sections);
}
\f
i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu)
# Target: FreeBSD/i386
gdb_target_obs="i386-tdep.o i387-tdep.o i386bsd-tdep.o i386fbsd-tdep.o \
- bsd-uthread.o solib-svr4.o"
+ bsd-uthread.o fbsd-tdep.o solib-svr4.o"
;;
i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu)
# Target: NetBSD/i386
# Target: FreeBSD/amd64
gdb_target_obs="amd64-tdep.o amd64fbsd-tdep.o i386-tdep.o \
i387-tdep.o i386bsd-tdep.o i386fbsd-tdep.o \
- bsd-uthread.o solib-svr4.o"
+ bsd-uthread.o fbsd-tdep.o solib-svr4.o"
;;
x86_64-*-mingw* | x86_64-*-cygwin*)
# Target: MingW/amd64
#define I386_WINDOWS_SIZEOF_GREGSET 716
-/* Return the appropriate register set for the core section identified
- by SECT_NAME and SECT_SIZE. */
-
-static const struct regset *
-i386_windows_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name, size_t sect_size)
-{
- if (strcmp (sect_name, ".reg") == 0
- && sect_size == I386_WINDOWS_SIZEOF_GREGSET)
- return &i386_gregset;
-
- return NULL;
-}
-
struct cpms_data
{
struct gdbarch *gdbarch;
tdep->gregset_num_regs = ARRAY_SIZE (i386_windows_gregset_reg_offset);
tdep->sizeof_gregset = I386_WINDOWS_SIZEOF_GREGSET;
+ tdep->sizeof_fpregset = 0;
+
/* Core file support. */
- set_gdbarch_regset_from_core_section
- (gdbarch, i386_windows_regset_from_core_section);
set_gdbarch_core_xfer_shared_libraries
(gdbarch, windows_core_xfer_shared_libraries);
set_gdbarch_core_pid_to_str (gdbarch, i386_windows_core_pid_to_str);
NULL, i386_supply_fpregset, i386_collect_fpregset
};
-/* Return the appropriate register set for the core section identified
- by SECT_NAME and SECT_SIZE. */
+/* Default iterator over core file register note sections. */
-const struct regset *
-i386_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name, size_t sect_size)
+void
+i386_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ iterate_over_regset_sections_cb *cb,
+ void *cb_data,
+ const struct regcache *regcache)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
- return &i386_gregset;
-
- if (strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset)
- return tdep->fpregset;
-
- return NULL;
+ cb (".reg", tdep->sizeof_gregset, &i386_gregset, NULL, cb_data);
+ if (tdep->sizeof_fpregset)
+ cb (".reg2", tdep->sizeof_fpregset, tdep->fpregset, NULL, cb_data);
}
\f
/* If we have a register mapping, enable the generic core file
support, unless it has already been enabled. */
if (tdep->gregset_reg_offset
- && !gdbarch_regset_from_core_section_p (gdbarch)
&& !gdbarch_iterate_over_regset_sections_p (gdbarch))
- set_gdbarch_regset_from_core_section (gdbarch,
- i386_regset_from_core_section);
+ set_gdbarch_iterate_over_regset_sections
+ (gdbarch, i386_iterate_over_regset_sections);
set_gdbarch_skip_permanent_breakpoint (gdbarch,
i386_skip_permanent_breakpoint);
/* Floating-point register set. */
extern const struct regset i386_fpregset;
-/* Return the appropriate register set for the core section identified
- by SECT_NAME and SECT_SIZE. */
-extern const struct regset *
- i386_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name, size_t sect_size);
-
+/* Default iterator over core file register note sections. */
+extern void
+ i386_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ iterate_over_regset_sections_cb *cb,
+ void *cb_data,
+ const struct regcache *regcache);
extern struct displaced_step_closure *i386_displaced_step_copy_insn
(struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to,
t->to_resume = i386fbsd_resume;
t->to_pid_to_exec_file = fbsd_pid_to_exec_file;
t->to_find_memory_regions = fbsd_find_memory_regions;
- t->to_make_corefile_notes = fbsd_make_corefile_notes;
add_target (t);
/* Support debugging kernel virtual memory images. */
#include "i386-tdep.h"
#include "i387-tdep.h"
#include "bsd-uthread.h"
+#include "fbsd-tdep.h"
#include "solib-svr4.h"
/* FreeBSD 3.0-RELEASE or later. */
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ /* Generic FreeBSD support. */
+ fbsd_init_abi (info, gdbarch);
+
/* Inherit stuff from older releases. We assume that FreeBSD
4.0-RELEASE always uses ELF. */
i386fbsd_init_abi (info, gdbarch);
NULL, i386obsd_aout_supply_regset, NULL
};
-static const struct regset *
-i386obsd_aout_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name,
- size_t sect_size)
+static void
+i386obsd_aout_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ iterate_over_regset_sections_cb *cb,
+ void *cb_data,
+ const struct regcache *regcache)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* OpenBSD a.out core dumps don't use seperate register sets for the
general-purpose and floating-point registers. */
- if (strcmp (sect_name, ".reg") == 0
- && sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
- return &i386obsd_aout_gregset;
-
- return NULL;
+ cb (".reg", tdep->sizeof_gregset + I387_SIZEOF_FSAVE,
+ &i386obsd_aout_gregset, NULL, cb_data);
}
\f
i386obsd_init_abi (info, gdbarch);
/* OpenBSD a.out has a single register set. */
- set_gdbarch_regset_from_core_section
- (gdbarch, i386obsd_aout_regset_from_core_section);
+ set_gdbarch_iterate_over_regset_sections
+ (gdbarch, i386obsd_aout_iterate_over_regset_sections);
}
/* OpenBSD ELF. */