aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.h
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2019-02-07 19:16:04 -0700
committerKevin Buettner <kevinb@redhat.com>2019-04-08 20:09:37 -0700
commit3d6c62048d8408fbfb6c66830e0c650e36259637 (patch)
treedc8bd93aae61f80fab0ea589241021691a733035 /gdb/target.h
parent462cac5884ed4c38e6180b2e2769aaa5225e695b (diff)
downloadgdb-3d6c62048d8408fbfb6c66830e0c650e36259637.zip
gdb-3d6c62048d8408fbfb6c66830e0c650e36259637.tar.gz
gdb-3d6c62048d8408fbfb6c66830e0c650e36259637.tar.bz2
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.
Diffstat (limited to 'gdb/target.h')
-rw-r--r--gdb/target.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h
index 4f7a43e..9078a42 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -659,6 +659,9 @@ struct target_ops
int,
inferior *inf)
TARGET_DEFAULT_RETURN (NULL);
+ /* See target_thread_info_to_thread_handle. */
+ virtual gdb::byte_vector thread_info_to_thread_handle (struct thread_info *)
+ TARGET_DEFAULT_RETURN (gdb::byte_vector ());
virtual void stop (ptid_t)
TARGET_DEFAULT_IGNORE ();
virtual void interrupt ()
@@ -1851,6 +1854,12 @@ extern const char *target_thread_name (struct thread_info *);
extern struct thread_info *target_thread_handle_to_thread_info
(const gdb_byte *thread_handle, int handle_len, struct inferior *inf);
+/* Given a thread, return the thread handle, a target-specific sequence of
+ bytes which serves as a thread identifier within the program being
+ debugged. */
+extern gdb::byte_vector target_thread_info_to_thread_handle
+ (struct thread_info *);
+
/* Attempts to find the pathname of the executable file
that was run to create a specified process.