[PATCH v2 03/47] infrun: Remove unnecessary currently_stepping call

Pedro Alves
2025-05-19T13:27:51Z

There's one unnecessary check for currently_stepping in
handle_signal_stop that can be removed. It is unnecessary because
currently_stepping is only ever called if
ecs->event_thread->control.trap_expected is true, and then if it is
true, then currently_stepping always returns true too.

Change-Id: I7b07bc62e8570333d2e4856d2e55ae6e58f8260c
---
gdb/infrun.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gdb/infrun.c b/gdb/infrun.c
index 0b872879961..119bd151034 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -7069,8 +7069,7 @@ handle_signal_stop (struct execution_control_state *ecs)

if (ecs->event_thread->stop_signal () == GDB_SIGNAL_TRAP
&& ecs->event_thread->control.trap_expected
- && gdbarch_single_step_through_delay_p (gdbarch)
- && currently_stepping (ecs->event_thread))
+ && gdbarch_single_step_through_delay_p (gdbarch))
{
/* We're trying to step off a breakpoint. Turns out that we're
also on an instruction that needs to be stepped multiple
--
2.49.0