diff options
author | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-02-17 16:12:01 +0100 |
---|---|---|
committer | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-02-20 17:35:17 +0100 |
commit | 79597bdd56f380555ed7075b39a9280a17bd7e90 (patch) | |
tree | 596147d06b37580578c6cd27b4e5ac245201f193 /gdbserver/linux-low.cc | |
parent | c0245cb999ec9692db1947240e865988a0c19c82 (diff) | |
download | gdb-79597bdd56f380555ed7075b39a9280a17bd7e90.zip gdb-79597bdd56f380555ed7075b39a9280a17bd7e90.tar.gz gdb-79597bdd56f380555ed7075b39a9280a17bd7e90.tar.bz2 |
gdbserver: turn btrace-related target ops into methods
gdbserver/ChangeLog:
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's btrace-related ops (enable_btrace,
disable_btrace, read_btrace, read_btrace_conf) into methods of
process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
(target_enable_btrace): Update.
(target_disable_btrace): Update.
(target_read_btrace): Update.
(target_read_btrace_conf): Update.
* target.cc (process_target::enable_btrace): Define.
(process_target::disable_btrace): Define.
(process_target::read_btrace): Define.
(process_target::read_btrace_conf): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target:enable_btrace): Define as a wrapper around
linux_enable_btrace.
(linux_low_disable_btrace): Turn into ...
(linux_process_target::disable_btrace): ... this.
(linux_low_read_btrace): Turn into ...
(linux_process_target::read_btrace): ... this.
(linux_low_btrace_conf): Turn into ...
(linux_process_target::read_btrace_conf): ... this.
* 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 | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc index df4c98d..1cd5bfc 100644 --- a/gdbserver/linux-low.cc +++ b/gdbserver/linux-low.cc @@ -7153,10 +7153,17 @@ linux_process_target::qxfer_libraries_svr4 (const char *annex, #ifdef HAVE_LINUX_BTRACE +btrace_target_info * +linux_process_target::enable_btrace (ptid_t ptid, + const btrace_config *conf) +{ + return linux_enable_btrace (ptid, conf); +} + /* See to_disable_btrace target method. */ -static int -linux_low_disable_btrace (struct btrace_target_info *tinfo) +int +linux_process_target::disable_btrace (btrace_target_info *tinfo) { enum btrace_error err; @@ -7215,9 +7222,10 @@ linux_low_encode_raw (struct buffer *buffer, const gdb_byte *data, /* See to_read_btrace target method. */ -static int -linux_low_read_btrace (struct btrace_target_info *tinfo, struct buffer *buffer, - enum btrace_read_type type) +int +linux_process_target::read_btrace (btrace_target_info *tinfo, + buffer *buffer, + enum btrace_read_type type) { struct btrace_data btrace; enum btrace_error err; @@ -7274,9 +7282,9 @@ linux_low_read_btrace (struct btrace_target_info *tinfo, struct buffer *buffer, /* See to_btrace_conf target method. */ -static int -linux_low_btrace_conf (const struct btrace_target_info *tinfo, - struct buffer *buffer) +int +linux_process_target::read_btrace_conf (const btrace_target_info *tinfo, + buffer *buffer) { const struct btrace_config *conf; @@ -7463,17 +7471,6 @@ linux_get_hwcap2 (int wordsize) static linux_process_target the_linux_target; static process_stratum_target linux_target_ops = { -#ifdef HAVE_LINUX_BTRACE - linux_enable_btrace, - linux_low_disable_btrace, - linux_low_read_btrace, - linux_low_btrace_conf, -#else - NULL, - NULL, - NULL, - NULL, -#endif linux_supports_range_stepping, linux_proc_pid_to_exec_file, linux_mntns_open_cloexec, |