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/linux-low.cc | |
parent | d367006fb7cf837210e2aa1944a11169a60039b4 (diff) | |
download | fsf-binutils-gdb-7f63b89b3a4229c2274f613111a907623853351f.zip fsf-binutils-gdb-7f63b89b3a4229c2274f613111a907623853351f.tar.gz fsf-binutils-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/linux-low.cc')
-rw-r--r-- | gdbserver/linux-low.cc | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc index 20a936b..f910866 100644 --- a/gdbserver/linux-low.cc +++ b/gdbserver/linux-low.cc @@ -7397,6 +7397,21 @@ linux_process_target::breakpoint_kind_from_current_state (CORE_ADDR *pcptr) return breakpoint_kind_from_pc (pcptr); } +const char * +linux_process_target::thread_name (ptid_t thread) +{ + return linux_proc_tid_get_name (thread); +} + +#if USE_THREAD_DB +bool +linux_process_target::thread_handle (ptid_t ptid, gdb_byte **handle, + int *handle_len) +{ + return thread_db_thread_handle (ptid, handle, handle_len); +} +#endif + /* Default implementation of linux_target_ops method "set_pc" for 32-bit pc register which is literally named "pc". */ @@ -7509,15 +7524,9 @@ linux_get_hwcap2 (int wordsize) static linux_process_target the_linux_target; static process_stratum_target linux_target_ops = { - linux_proc_tid_get_name, linux_supports_software_single_step, linux_supports_catch_syscall, linux_get_ipa_tdesc_idx, -#if USE_THREAD_DB - thread_db_thread_handle, -#else - NULL, -#endif &the_linux_target, }; |