From b25e22fd1698b600310fc56f01b6005b5a3f6227 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 17 Jun 2020 11:56:43 +0100 Subject: [PATCH] Update thread_control_state::trap_expected comments The comments describing trap_expected are out of date. It predates displaced stepping and non-stop mode ("keep other threads stopped"). It predates stepping over watchpoints with breakpoints inserted (keep_going_pass_signal). Says the variable is cleared in normal_stop, when it isn't. This fixes it. gdb/ChangeLog: 2020-06-17 Pedro Alves * gdbthread.h (thread_control_state) Update comments. --- gdb/ChangeLog | 5 +++++ gdb/gdbthread.h | 26 ++++---------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f4d9eaa5b4b..a231a09e21a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-06-17 Pedro Alves + + * gdbthread.h (thread_control_state) Update + comments. + 2020-06-17 Andrew Burgess * ada-lang.c (ada_lookup_symbol_nonlocal): Rename to diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index 717a2ad08c2..710b4c66a65 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -131,28 +131,10 @@ struct thread_control_state any inlined frames). */ struct frame_id step_stack_frame_id {}; - /* Nonzero if we are presently stepping over a breakpoint. - - If we hit a breakpoint or watchpoint, and then continue, we need - to single step the current thread with breakpoints disabled, to - avoid hitting the same breakpoint or watchpoint again. And we - should step just a single thread and keep other threads stopped, - so that other threads don't miss breakpoints while they are - removed. - - So, this variable simultaneously means that we need to single - step the current thread, keep other threads stopped, and that - breakpoints should be removed while we step. - - This variable is set either: - - in proceed, when we resume inferior on user's explicit request - - in keep_going, if handle_inferior_event decides we need to - step over breakpoint. - - The variable is cleared in normal_stop. The proceed calls - wait_for_inferior, which calls handle_inferior_event in a loop, - and until wait_for_inferior exits, this variable is changed only - by keep_going. */ + /* True if the the thread is presently stepping over a breakpoint or + a watchpoint, either with an inline step over or a displaced (out + of line) step, and we're now expecting it to report a trap for + the finished single step. */ int trap_expected = 0; /* Nonzero if the thread is being proceeded for a "finish" command -- 2.30.2