aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorPatrick Monnerat <patrick@monnerat.net>2022-03-12 13:41:47 +0100
committerTom Tromey <tromey@adacore.com>2022-03-14 07:49:18 -0600
commitfb85cece22a2cb3c0185e61cfc1323e9c5a6466e (patch)
tree24e2ccdafd6784676763833be4b45d9614fa0652 /gdb/infrun.c
parent79a0742380b5304c734ce6f4359d437325cc7121 (diff)
downloadgdb-fb85cece22a2cb3c0185e61cfc1323e9c5a6466e.zip
gdb-fb85cece22a2cb3c0185e61cfc1323e9c5a6466e.tar.gz
gdb-fb85cece22a2cb3c0185e61cfc1323e9c5a6466e.tar.bz2
Replace deprecated_target_wait_hook by observers
Commit b60cea7 (Make target_wait options use enum flags) broke deprecated_target_wait_hook usage: there's a commit comment telling this hook has not been converted. Rather than trying to mend it, this patch replaces the hook by two target_wait observers: target_pre_wait (ptid_t ptid) target_post_wait (ptid_t event_ptid) Upon target_wait entry, target_pre_wait is notified with the ptid passed to target_wait. Upon exit, target_post_wait is notified with the event ptid returned by target_wait. Should an exception occur, event_ptid is null_ptid. This change benefits to Insight (out-of-tree): there's no real use of the late hook in gdb itself.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index e3c1db7..bc6521c 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -367,7 +367,7 @@ show_stop_on_solib_events (struct ui_file *file, int from_tty,
static bool stop_print_frame;
/* This is a cached copy of the target/ptid/waitstatus of the last
- event returned by target_wait()/deprecated_target_wait_hook().
+ event returned by target_wait().
This information is returned by get_last_target_status(). */
static process_stratum_target *target_last_proc_target;
static ptid_t target_last_wait_ptid;
@@ -3515,7 +3515,6 @@ static ptid_t
do_target_wait_1 (inferior *inf, ptid_t ptid,
target_waitstatus *status, target_wait_flags options)
{
- ptid_t event_ptid;
struct thread_info *tp;
/* We know that we are looking for an event in the target of inferior
@@ -3630,12 +3629,7 @@ do_target_wait_1 (inferior *inf, ptid_t ptid,
if (!target_can_async_p ())
options &= ~TARGET_WNOHANG;
- if (deprecated_target_wait_hook)
- event_ptid = deprecated_target_wait_hook (ptid, status, options);
- else
- event_ptid = target_wait (ptid, status, options);
-
- return event_ptid;
+ return target_wait (ptid, status, options);
}
/* Wrapper for target_wait that first checks whether threads have
@@ -4591,10 +4585,7 @@ poll_one_curr_target (struct target_waitstatus *ws)
don't get any event. */
target_dcache_invalidate ();
- if (deprecated_target_wait_hook)
- event_ptid = deprecated_target_wait_hook (minus_one_ptid, ws, TARGET_WNOHANG);
- else
- event_ptid = target_wait (minus_one_ptid, ws, TARGET_WNOHANG);
+ event_ptid = target_wait (minus_one_ptid, ws, TARGET_WNOHANG);
if (debug_infrun)
print_target_wait_results (minus_one_ptid, event_ptid, *ws);