Skip to content

Commit 91110b8

Browse files
committed
[lldb][Target] Clear selected frame index after a StopInfo::PerformAction
1 parent 976e413 commit 91110b8

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

lldb/include/lldb/Target/StackFrameList.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class StackFrameList {
4646
/// Mark a stack frame as the currently selected frame and return its index.
4747
uint32_t SetSelectedFrame(lldb_private::StackFrame *frame);
4848

49+
/// Resets the selected frame index of this object.
50+
void ClearSelectedFrameIndex();
51+
4952
/// Get the currently selected frame index.
5053
/// We should only call SelectMostRelevantFrame if (a) the user hasn't already
5154
/// selected a frame, and (b) if this really is a user facing

lldb/include/lldb/Target/Thread.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,11 @@ class Thread : public std::enable_shared_from_this<Thread>,
480480
bool SetSelectedFrameByIndexNoisily(uint32_t frame_idx,
481481
Stream &output_stream);
482482

483+
/// Resets the selected frame index of this object.
484+
void ClearSelectedFrameIndex() {
485+
return GetStackFrameList()->ClearSelectedFrameIndex();
486+
}
487+
483488
void SetDefaultFileAndLineToSelectedFrame() {
484489
GetStackFrameList()->SetDefaultFileAndLineToSelectedFrame();
485490
}

lldb/source/Target/Process.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4257,6 +4257,8 @@ bool Process::ProcessEventData::ShouldStop(Event *event_ptr,
42574257
// appropriately. We also need to stop processing actions, since they
42584258
// aren't expecting the target to be running.
42594259

4260+
thread_sp->ClearSelectedFrameIndex();
4261+
42604262
// FIXME: we might have run.
42614263
if (stop_info_sp->HasTargetRunSinceMe()) {
42624264
SetRestarted(true);

lldb/source/Target/StackFrameList.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,3 +936,7 @@ size_t StackFrameList::GetStatus(Stream &strm, uint32_t first_frame,
936936
strm.IndentLess();
937937
return num_frames_displayed;
938938
}
939+
940+
void StackFrameList::ClearSelectedFrameIndex() {
941+
m_selected_frame_idx.reset();
942+
}

0 commit comments

Comments
 (0)