Skip to content

Commit a7a06cf

Browse files
committed
When the Debugger runs HandleProcessEvent it should allow
selecting the "Most relevant" frame. If you don't do that, then the correct frame gets selected, but it happens AFTER the frame info gets printed in the stop message, so you don't see the selected frame. The test for this hid the issue because it ran `frame info` and checked the result of that. That happens after the recognizer selects the frame, and so it was right. But if the recognizer is working correctly it will have already done the same printing in the stop message, and this way we also verify that the stop message was right. Differential Revision: https://reviews.llvm.org/D150315 (cherry picked from commit 7b5dc63)
1 parent 2350f42 commit a7a06cf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lldb/source/Core/Debugger.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,8 +1664,10 @@ void Debugger::HandleProcessEvent(const EventSP &event_sp) {
16641664

16651665
// Display running state changes first before any STDIO
16661666
if (got_state_changed && !state_is_stopped) {
1667+
// This is a public stop which we are going to announce to the user, so
1668+
// we should force the most relevant frame selection here.
16671669
Process::HandleProcessStateChangedEvent(event_sp, output_stream_sp.get(),
1668-
DoNoSelectMostRelevantFrame,
1670+
SelectMostRelevantFrame,
16691671
pop_process_io_handler,
16701672
// BEGIN SWIFT
16711673
pop_command_interpreter
@@ -1709,7 +1711,7 @@ void Debugger::HandleProcessEvent(const EventSP &event_sp) {
17091711
// Now display any stopped state changes after any STDIO
17101712
if (got_state_changed && state_is_stopped) {
17111713
Process::HandleProcessStateChangedEvent(event_sp, output_stream_sp.get(),
1712-
DoNoSelectMostRelevantFrame,
1714+
SelectMostRelevantFrame,
17131715
pop_process_io_handler,
17141716
// BEGIN SWIFT
17151717
pop_command_interpreter

lldb/test/Shell/Recognizer/assert.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# RUN: %lldb -b -s %s %t.out | FileCheck %s
1111
run
1212
# CHECK: thread #{{.*}}stop reason = hit program assert
13-
frame info
1413
# CHECK: frame #{{.*}}`main at assert.c
1514
frame recognizer info 0
1615
# CHECK: frame 0 is recognized by Assert StackFrame Recognizer

0 commit comments

Comments
 (0)