From ab1ddbcf110a3f1ad45e3a346d2da98ffb833dec Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 10 Jan 2020 20:05:49 +0000 Subject: Some get_last_target_status tweaks - Make get_last_target_status arguments optional. A following patch will add another argument to get_last_target_status (the event's target), and passing nullptr when we don't care for some piece of info is handier than creating dummy local variables. - Declare nullify_last_target_wait_ptid in a header, and remove the local extern declaration from linux-fork.c. gdb/ChangeLog: 2020-01-10 Pedro Alves * break-catch-sig.c (signal_catchpoint_print_it): Don't pass a ptid to get_last_target_status. * break-catch-syscall.c (print_it_catch_syscall): Don't pass a ptid to get_last_target_status. * infcmd.c (continue_command): Don't pass a target_waitstatus to get_last_target_status. (info_program_command): Don't pass a target_waitstatus to get_last_target_status. * infrun.c (init_wait_for_inferior): Use nullify_last_target_wait_ptid. (get_last_target_status): Handle nullptr arguments. (nullify_last_target_wait_ptid): Clear target_last_waitstatus. (print_stop_event): Don't pass a ptid to get_last_target_status. (normal_stop): Don't pass a ptid to get_last_target_status. * infrun.h (get_last_target_status, set_last_target_status): Move comments here and update. (nullify_last_target_wait_ptid): Declare. * linux-fork.c (fork_load_infrun_state): Remove local extern declaration of nullify_last_target_wait_ptid. * linux-nat.c (get_detach_signal): Don't pass a target_waitstatus to get_last_target_status. --- gdb/infrun.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gdb/infrun.h') diff --git a/gdb/infrun.h b/gdb/infrun.h index 9125141..4dd995d 100644 --- a/gdb/infrun.h +++ b/gdb/infrun.h @@ -101,12 +101,21 @@ extern void wait_for_inferior (void); target, false otherwise. */ extern int normal_stop (void); +/* Return the cached copy of the last ptid/waitstatus returned + by target_wait()/deprecated_target_wait_hook(). The data is + actually cached by handle_inferior_event(), which gets called + immediately after target_wait()/deprecated_target_wait_hook(). */ extern void get_last_target_status (ptid_t *ptid, struct target_waitstatus *status); +/* Set the cached copy of the last ptid/waitstatus. */ extern void set_last_target_status (ptid_t ptid, struct target_waitstatus status); +/* Clear the cached copy of the last ptid/waitstatus returned by + target_wait(). */ +extern void nullify_last_target_wait_ptid (); + /* Stop all threads. Only returns after everything is halted. */ extern void stop_all_threads (void); -- cgit v1.1