diff options
author | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-02-17 16:11:53 +0100 |
---|---|---|
committer | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-02-20 17:35:05 +0100 |
commit | 79b4408780b27eeb60de7f3fe10bc654dddcf067 (patch) | |
tree | a5e3f35e999c60cd768f29be023cdb523a2b8995 /gdbserver/target.cc | |
parent | a5a4d4cd0c5fb2240d8157c98e2fe5078f9d3263 (diff) | |
download | gdb-79b4408780b27eeb60de7f3fe10bc654dddcf067.zip gdb-79b4408780b27eeb60de7f3fe10bc654dddcf067.tar.gz gdb-79b4408780b27eeb60de7f3fe10bc654dddcf067.tar.bz2 |
gdbserver: turn prepare_to_access_memory & done_accessing_memory into methods
gdbserver/ChangeLog:
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's prepare_to_access_memory and
done_accessing_memory ops into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
* target.cc (process_target::prepare_to_access_memory): Define.
(process_target::done_accessing_memory): Define.
(prepare_to_access_memory): Update.
(done_accessing_memory): Update.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_prepare_to_access_memory): Turn into ...
(linux_process_target::prepare_to_access_memory): ... this.
(linux_done_accessing_memory): Turn into ...
(linux_process_target::done_accessing_memory): ... 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/target.cc')
-rw-r--r-- | gdbserver/target.cc | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/gdbserver/target.cc b/gdbserver/target.cc index b73c446..f88e9fa 100644 --- a/gdbserver/target.cc +++ b/gdbserver/target.cc @@ -57,14 +57,9 @@ prepare_to_access_memory (void) it. */ prev_general_thread = cs.general_thread; - if (the_target->prepare_to_access_memory != NULL) - { - int res; - - res = the_target->prepare_to_access_memory (); - if (res != 0) - return res; - } + int res = the_target->pt->prepare_to_access_memory (); + if (res != 0) + return res; for_each_thread (prev_general_thread.pid (), [&] (thread_info *thread) { @@ -114,8 +109,7 @@ done_accessing_memory (void) { client_state &cs = get_client_state (); - if (the_target->done_accessing_memory != NULL) - the_target->done_accessing_memory (); + the_target->pt->done_accessing_memory (); /* Restore the previous selected thread. */ cs.general_thread = prev_general_thread; @@ -402,3 +396,15 @@ process_target::post_create_inferior () { /* Nop. */ } + +int +process_target::prepare_to_access_memory () +{ + return 0; +} + +void +process_target::done_accessing_memory () +{ + /* Nop. */ +} |