diff options
author | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-02-17 16:12:02 +0100 |
---|---|---|
committer | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-02-20 17:35:18 +0100 |
commit | 7f63b89b3a4229c2274f613111a907623853351f (patch) | |
tree | cd1dd7247880d77de2ed4618451b4fc3bb095a96 /gdbserver/target.h | |
parent | d367006fb7cf837210e2aa1944a11169a60039b4 (diff) | |
download | gdb-7f63b89b3a4229c2274f613111a907623853351f.zip gdb-7f63b89b3a4229c2274f613111a907623853351f.tar.gz gdb-7f63b89b3a4229c2274f613111a907623853351f.tar.bz2 |
gdbserver: turn target ops 'thread_name' and 'thread_handle' into methods
gdbserver/ChangeLog:
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's thread_name and thread_handle ops
into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
(target_thread_name): Update the macro.
(target_thread_handle): Update the macro.
* target.cc (process_target::thread_name): Define.
(process_target::thread_handle): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::thread_name): Define.
(linux_process_target::thread_handle): Define.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
Diffstat (limited to 'gdbserver/target.h')
-rw-r--r-- | gdbserver/target.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/gdbserver/target.h b/gdbserver/target.h index 4651e44..4d9de55 100644 --- a/gdbserver/target.h +++ b/gdbserver/target.h @@ -70,10 +70,6 @@ class process_target; shared code. */ struct process_stratum_target { - /* Return the thread's name, or NULL if the target is unable to determine it. - The returned value must not be freed by the caller. */ - const char *(*thread_name) (ptid_t thread); - /* Returns true if the target can software single step. */ int (*supports_software_single_step) (void); @@ -84,11 +80,6 @@ struct process_stratum_target /* Return tdesc index for IPA. */ int (*get_ipa_tdesc_idx) (void); - /* Thread ID to (numeric) thread handle: Return true on success and - false for failure. Return pointer to thread handle via HANDLE - and the handle's length via HANDLE_LEN. */ - bool (*thread_handle) (ptid_t ptid, gdb_byte **handle, int *handle_len); - /* The object that will gradually replace this struct. */ process_target *pt; }; @@ -503,6 +494,17 @@ public: PC. The PCPTR is adjusted to the real memory location in case a flag (e.g., the Thumb bit on ARM) is present in the PC. */ virtual int breakpoint_kind_from_current_state (CORE_ADDR *pcptr); + + /* Return the thread's name, or NULL if the target is unable to + determine it. The returned value must not be freed by the + caller. */ + virtual const char *thread_name (ptid_t thread); + + /* Thread ID to (numeric) thread handle: Return true on success and + false for failure. Return pointer to thread handle via HANDLE + and the handle's length via HANDLE_LEN. */ + virtual bool thread_handle (ptid_t ptid, gdb_byte **handle, + int *handle_len); }; extern process_stratum_target *the_target; @@ -683,13 +685,10 @@ void done_accessing_memory (void); the_target->pt->core_of_thread (ptid) #define target_thread_name(ptid) \ - (the_target->thread_name ? (*the_target->thread_name) (ptid) \ - : NULL) + the_target->pt->thread_name (ptid) #define target_thread_handle(ptid, handle, handle_len) \ - (the_target->thread_handle ? (*the_target->thread_handle) \ - (ptid, handle, handle_len) \ - : false) + the_target->pt->thread_handle (ptid, handle, handle_len) int read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len); |