aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2017-06-28 11:11:20 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2017-07-07 16:08:33 -0700
commit382b69bbb7a4fec5213d2382fe70a68d7a46b3e7 (patch)
treeda98991f5df0b8bda0d6f31efa9e60de482e832c /gdb/gdbarch.c
parent6e5eab33abe09041b29e0ce484f684ad0ffe80a5 (diff)
downloadgdb-382b69bbb7a4fec5213d2382fe70a68d7a46b3e7.zip
gdb-382b69bbb7a4fec5213d2382fe70a68d7a46b3e7.tar.gz
gdb-382b69bbb7a4fec5213d2382fe70a68d7a46b3e7.tar.bz2
Add a new gdbarch method to fetch signal information from core files.
Previously the core_xfer_partial method used core_get_siginfo to handle TARGET_OBJECT_SIGNAL_INFO requests. However, core_get_siginfo looked for Linux-specific sections in the core file. To support fetching siginfo from cores on other systems, add a new gdbarch method (`core_xfer_siginfo`) and move the body of the existing core_get_siginfo into a linux_core_xfer_siginfo implementation of this method in linux-tdep.c. gdb/ChangeLog: * corelow.c (get_core_siginfo): Remove. (core_xfer_partial): Use the gdbarch "core_xfer_siginfo" method instead of get_core_siginfo. * gdbarch.sh (core_xfer_siginfo): New gdbarch callback. * gdbarch.h: Re-generate. * gdbarch.c: Re-generate. * linux-tdep.c (linux_core_xfer_siginfo): New. (linux_init_abi): Install gdbarch "core_xfer_siginfo" method.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index e5efdfb..24521b5 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -287,6 +287,7 @@ struct gdbarch
gdbarch_core_xfer_shared_libraries_aix_ftype *core_xfer_shared_libraries_aix;
gdbarch_core_pid_to_str_ftype *core_pid_to_str;
gdbarch_core_thread_name_ftype *core_thread_name;
+ gdbarch_core_xfer_siginfo_ftype *core_xfer_siginfo;
const char * gcore_bfd_target;
int vtable_function_descriptors;
int vbit_in_delta;
@@ -646,6 +647,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of core_xfer_shared_libraries_aix, has predicate. */
/* Skip verify of core_pid_to_str, has predicate. */
/* Skip verify of core_thread_name, has predicate. */
+ /* Skip verify of core_xfer_siginfo, has predicate. */
/* Skip verify of gcore_bfd_target, has predicate. */
/* Skip verify of vtable_function_descriptors, invalid_p == 0 */
/* Skip verify of vbit_in_delta, invalid_p == 0 */
@@ -884,6 +886,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: core_xfer_shared_libraries_aix = <%s>\n",
host_address_to_string (gdbarch->core_xfer_shared_libraries_aix));
fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_core_xfer_siginfo_p() = %d\n",
+ gdbarch_core_xfer_siginfo_p (gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: core_xfer_siginfo = <%s>\n",
+ host_address_to_string (gdbarch->core_xfer_siginfo));
+ fprintf_unfiltered (file,
"gdbarch_dump: decr_pc_after_break = %s\n",
core_addr_to_string_nz (gdbarch->decr_pc_after_break));
fprintf_unfiltered (file,
@@ -3797,6 +3805,30 @@ set_gdbarch_core_thread_name (struct gdbarch *gdbarch,
}
int
+gdbarch_core_xfer_siginfo_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->core_xfer_siginfo != NULL;
+}
+
+LONGEST
+gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->core_xfer_siginfo != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_core_xfer_siginfo called\n");
+ return gdbarch->core_xfer_siginfo (gdbarch, readbuf, offset, len);
+}
+
+void
+set_gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch,
+ gdbarch_core_xfer_siginfo_ftype core_xfer_siginfo)
+{
+ gdbarch->core_xfer_siginfo = core_xfer_siginfo;
+}
+
+int
gdbarch_gcore_bfd_target_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);