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.
This commit is contained in:
John Baldwin
2016-01-18 09:49:23 -08:00
parent 5b2c414df1
commit 4dfc5dbc4e
5 changed files with 64 additions and 0 deletions

View File

@@ -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;