Introduce target_ops method thread_info_to_thread_handle

This patch adds a thread_info_to_thread_handle method to the target_ops
struct.  It also implements this functionality for remote targets and
linux native threads.

gdb/ChangeLog:

	* gdbthread.h (thread_to_thread_handle): Declare.
	* thread.c (gdbtypes.h): Include.
	(thread_to_thread_handle): New function.

	* target.h (struct target_ops): Add thread_info_to_thread_handle.
	(target_thread_info_to_thread_handle): Declare.
	* target.c (target_thread_info_to_thread_handle): New function.
	* target-debug.h (target_debug_print_gdb_byte_vector): Define.
	* target-delegates.c: Regenerate.

	* linux-thread-db.c (class thread_db_target): Add method
	thread_info_to_thread_handle.
	(thread_db_target::thread_info_to_thread_handle): Define.
	* remote.c (class remote_target): Add new method
	thread_info_to_thread_handle.
	(remote_target::thread_info_to_thread_handle): Define.
This commit is contained in:
Kevin Buettner
2019-02-07 19:16:04 -07:00
parent 462cac5884
commit 3d6c62048d
7 changed files with 95 additions and 0 deletions

View File

@@ -2097,6 +2097,14 @@ target_thread_handle_to_thread_info (const gdb_byte *thread_handle,
handle_len, inf);
}
/* See target.h. */
gdb::byte_vector
target_thread_info_to_thread_handle (struct thread_info *tip)
{
return current_top_target ()->thread_info_to_thread_handle (tip);
}
void
target_resume (ptid_t ptid, int step, enum gdb_signal signal)
{