diff options
author | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-02-17 16:12:00 +0100 |
---|---|---|
committer | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-02-20 17:35:14 +0100 |
commit | 29e8dc09ff78e102ede0cdbb802cb771613bb8b1 (patch) | |
tree | e2b59f98ed2614089d6d810a913716ef7ada220f /gdbserver/target.h | |
parent | 4e2e869cb3336beb959a969e7b7c7897583ef16e (diff) | |
download | binutils-gdb-29e8dc09ff78e102ede0cdbb802cb771613bb8b1.tar.gz |
gdbserver: turn target ops 'pause_all' and 'unpause_all' into methods
gdbserver/ChangeLog:
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's pause_all and unpause_all ops
into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
(pause_all): Update the macro and rename to...
(target_pause_all): ... this.
(unpause_all): Update the macro and rename to...
(target_unpause_all): ... this.
* target.cc (process_target::pause_all): Define.
(process_target::unpause_all): Define.
Update the derived classes and callers below.
* server.cc (handle_status): Update.
* tracepoint.cc (clear_installed_tracepoints): Update.
(cmd_qtdp): Update.
(cmd_qtstart): Update.
(stop_tracing): Update.
(cmd_qtstatus): Update.
(upload_fast_traceframes): Update.
(run_inferior_command): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_pause_all): Turn into ...
(linux_process_target::pause_all): ... this.
(linux_unpause_all): Turn into ...
(linux_process_target::unpause_all): ... this.
(linux_process_target::prepare_to_access_memory): Update.
(linux_process_target::done_accessing_memory): Update.
* 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 | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/gdbserver/target.h b/gdbserver/target.h index 4da15a06734..60fb14f69e6 100644 --- a/gdbserver/target.h +++ b/gdbserver/target.h @@ -70,18 +70,6 @@ class process_target; shared code. */ struct process_stratum_target { - /* Pause all threads. If FREEZE, arrange for any resume attempt to - be ignored until an unpause_all call unfreezes threads again. - There can be nested calls to pause_all, so a freeze counter - should be maintained. */ - void (*pause_all) (int freeze); - - /* Unpause all threads. Threads that hadn't been resumed by the - client should be left stopped. Basically a pause/unpause call - pair should not end up resuming threads that were stopped before - the pause call. */ - void (*unpause_all) (int unfreeze); - /* Stabilize all threads. That is, force them out of jump pads. */ void (*stabilize_threads) (void); @@ -494,6 +482,18 @@ public: /* Read Thread Information Block address. */ virtual int get_tib_address (ptid_t ptid, CORE_ADDR *address); + + /* Pause all threads. If FREEZE, arrange for any resume attempt to + be ignored until an unpause_all call unfreezes threads again. + There can be nested calls to pause_all, so a freeze counter + should be maintained. */ + virtual void pause_all (bool freeze); + + /* Unpause all threads. Threads that hadn't been resumed by the + client should be left stopped. Basically a pause/unpause call + pair should not end up resuming threads that were stopped before + the pause call. */ + virtual void unpause_all (bool unfreeze); }; extern process_stratum_target *the_target; @@ -568,19 +568,11 @@ int kill_inferior (process_info *proc); #define target_thread_stopped(thread) \ the_target->pt->thread_stopped (thread) -#define pause_all(freeze) \ - do \ - { \ - if (the_target->pause_all) \ - (*the_target->pause_all) (freeze); \ - } while (0) +#define target_pause_all(freeze) \ + the_target->pt->pause_all (freeze) -#define unpause_all(unfreeze) \ - do \ - { \ - if (the_target->unpause_all) \ - (*the_target->unpause_all) (unfreeze); \ - } while (0) +#define target_unpause_all(unfreeze) \ + the_target->pt->unpause_all (unfreeze) #define stabilize_threads() \ do \ |