forked from Imagelibrary/binutils-gdb
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 <palves@redhat.com> * 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.
This commit is contained in:
@@ -851,9 +851,8 @@ continue_command (const char *args, int from_tty)
|
||||
else
|
||||
{
|
||||
ptid_t last_ptid;
|
||||
struct target_waitstatus ws;
|
||||
|
||||
get_last_target_status (&last_ptid, &ws);
|
||||
get_last_target_status (&last_ptid, nullptr);
|
||||
tp = find_thread_ptid (last_ptid);
|
||||
}
|
||||
if (tp != NULL)
|
||||
@@ -1993,11 +1992,7 @@ info_program_command (const char *args, int from_tty)
|
||||
if (non_stop)
|
||||
ptid = inferior_ptid;
|
||||
else
|
||||
{
|
||||
struct target_waitstatus ws;
|
||||
|
||||
get_last_target_status (&ptid, &ws);
|
||||
}
|
||||
get_last_target_status (&ptid, nullptr);
|
||||
|
||||
if (ptid == null_ptid || ptid == minus_one_ptid)
|
||||
error (_("No selected thread."));
|
||||
|
||||
Reference in New Issue
Block a user