[RFC,3/8] gdb, infrun: simplify print_stop_location()
Checks
Commit Message
print_stop_location() expects its argument waitstatus to match
inferior_thread()'s control.stop_bpstat.
Instead, use inferior_thread()'s last waitstatus that the parent patch
stored in control.stop_ws.
This removes the need for a waitstatus parameter. Change it to take the
thread to print the stop location for.
---
gdb/infrun.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
@@ -9441,14 +9441,14 @@ print_no_history_reason (struct ui_out *uiout)
based on the event(s) that just occurred. */
static void
-print_stop_location (const target_waitstatus &ws)
+print_stop_location (thread_info *tp)
{
int bpstat_ret;
enum print_what source_flag;
int do_frame_printing = 1;
- struct thread_info *tp = inferior_thread ();
- bpstat_ret = bpstat_print (tp->control.stop_bpstat, ws.kind ());
+ bpstat_ret = bpstat_print (tp->control.stop_bpstat,
+ tp->control.stop_ws.kind ());
/* Function bpstat_print selects the frame to print. Typically, that is the
stop frame, in other words get_current_frame (). But bpstat_print may
select a different frame, see for instance ada_catchpoint::print_it. */
@@ -9516,22 +9516,17 @@ print_stop_location (const target_waitstatus &ws)
static void
do_print_stop_event (struct ui_out *uiout, bool displays)
{
- struct target_waitstatus last;
- struct thread_info *tp;
-
- get_last_target_status (nullptr, nullptr, &last);
-
+ struct thread_info *tp = inferior_thread ();
{
scoped_restore save_uiout = make_scoped_restore (¤t_uiout, uiout);
- print_stop_location (last);
+ print_stop_location (tp);
/* Display the auto-display expressions. */
if (displays)
do_displays ();
}
- tp = inferior_thread ();
if (tp->thread_fsm () != nullptr
&& tp->thread_fsm ()->finished_p ())
{