aboutsummaryrefslogtreecommitdiff
path: root/gdb/corelow.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2016-01-18 09:49:23 -0800
committerJohn Baldwin <jhb@FreeBSD.org>2016-01-19 08:18:20 -0800
commit4dfc5dbc4e1b267d440dd515a42fe6fd96a8d860 (patch)
tree6cec1021e910abd6adbf097333c65669d188e0b9 /gdb/corelow.c
parent5b2c414df12bb61ab1e40099b92fc8f00983b930 (diff)
downloadgdb-4dfc5dbc4e1b267d440dd515a42fe6fd96a8d860.zip
gdb-4dfc5dbc4e1b267d440dd515a42fe6fd96a8d860.tar.gz
gdb-4dfc5dbc4e1b267d440dd515a42fe6fd96a8d860.tar.bz2
Add support for extracting thread names from cores.
Add a new gdbarch method to extract a thread name from a core for a given thread. Use this new method in core_thread_name to implement the to_thread_name target op. gdb/ChangeLog: * corelow.c (core_thread_name): New function. (init_core_ops): Use "core_thread_name" for the "to_thread_name" target op. * gdbarch.sh (core_thread_name): New gdbarch callback. * gdbarch.h: Re-generate. * gdbarch.c: Re-generate.
Diffstat (limited to 'gdb/corelow.c')
-rw-r--r--gdb/corelow.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 90e3d56..224719e 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -986,6 +986,15 @@ core_pid_to_str (struct target_ops *ops, ptid_t ptid)
return buf;
}
+static const char *
+core_thread_name (struct target_ops *self, struct thread_info *thr)
+{
+ if (core_gdbarch
+ && gdbarch_core_thread_name_p (core_gdbarch))
+ return gdbarch_core_thread_name (core_gdbarch, thr);
+ return NULL;
+}
+
static int
core_has_memory (struct target_ops *ops)
{
@@ -1038,6 +1047,7 @@ init_core_ops (void)
core_ops.to_thread_alive = core_thread_alive;
core_ops.to_read_description = core_read_description;
core_ops.to_pid_to_str = core_pid_to_str;
+ core_ops.to_thread_name = core_thread_name;
core_ops.to_stratum = process_stratum;
core_ops.to_has_memory = core_has_memory;
core_ops.to_has_stack = core_has_stack;