When stepping past the reverse execution history buffer bounds gdb prints 'No more reverse-execution history' to the output but does not give a reason in the MI stopped event, leading to a bad UX. https://github.com/microsoft/MIEngine/pull/1037#issuecomment-750299377 1: (62155) <-1057-exec-next --reverse 1: (62156) ->1057^running 1: (62156) ->*running,thread-id="1" 1: (62156) ->(gdb) 1: (62163) ->~"\nNo more reverse-execution history.\n" 1: (62164) ->~"main (argc=1, argv=0x7fffffffdb78) at ../test.cpp:25\n" 1: (62164) ->~"25\t\tstd::u16string s = u\"test\";\n" 1: (62164) ->*stopped,frame={addr="0x000055555555734b",func="main",args=[{name="argc",value="1"},{name="argv",value="0x7fffffffdb78"}],file="../test.cpp",fullname="/tmp/test.cpp",line="25",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="2" Test case: https://github.com/microsoft/MIEngine/pull/1037#issuecomment-1158743492 int main() { int i = 0; ++i; ++i; return i; } $ gdb --batch -ex 'b main' -ex r -ex n -ex 'p i' -ex 'record full' -ex n -ex 'p i' -ex n -ex 'p i' -ex n -ex 'p i' -ex 'reverse-next' -ex 'p i' -ex 'reverse-next' -ex 'p i' -ex 'reverse-next' -ex 'p i' test
Code of interest: handle_inferior_event(infrun.c:5858): case TARGET_WAITKIND_NO_HISTORY: /* Reverse execution: target ran out of history info. */ /* Switch to the stopped thread. */ context_switch (ecs); infrun_debug_printf ("stopped"); delete_just_stopped_threads_single_step_breakpoints (); ecs->event_thread->set_stop_pc (regcache_read_pc (get_thread_regcache (inferior_thread ()))); if (handle_stop_requested (ecs)) return; gdb::observers::no_history.notify (); // just prints the line in print_no_history_reason stop_waiting (ecs);
FWIW I think there may be other cases where a stop reason is missing.
I also saw https://sourceware.org/bugzilla/show_bug.cgi?id=15072 about reverse finish with breakpoints. But that's about the whole stopped event missing.
Commit 37f54063ed0daaffbd52f69efbdb4c8e0a9c9cca gdb/mi: add no-history stop reason fixed this bug (but I forgot to reference this bug, oops). It is fixed on master now.