Skip to content

Commit c923808

Browse files
author
git apple-llvm automerger
committed
Merge commit 'ddbce2fd2380' from llvm.org/main into next
2 parents 985cdfa + ddbce2f commit c923808

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

lldb/include/lldb/Target/ThreadPlanShouldStopHere.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ class ThreadPlanShouldStopHere {
5959
eNone = 0,
6060
eAvoidInlines = (1 << 0),
6161
eStepInAvoidNoDebug = (1 << 1),
62-
eStepOutAvoidNoDebug = (1 << 2)
62+
eStepOutAvoidNoDebug = (1 << 2),
63+
eStepOutPastThunks = (1 << 3)
6364
};
6465

6566
// Constructors and Destructors

lldb/source/Target/ThreadPlanShouldStopHere.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "lldb/Target/ThreadPlanShouldStopHere.h"
1010
#include "lldb/Symbol/Function.h"
1111
#include "lldb/Symbol/Symbol.h"
12+
#include "lldb/Target/Language.h"
1213
#include "lldb/Target/LanguageRuntime.h"
1314
#include "lldb/Target/Process.h"
1415
#include "lldb/Target/RegisterContext.h"
@@ -85,7 +86,12 @@ bool ThreadPlanShouldStopHere::DefaultShouldStopHereCallback(
8586
if (Symbol *symbol = frame->GetSymbolContext(eSymbolContextSymbol).symbol) {
8687
ProcessSP process_sp(current_plan->GetThread().GetProcess());
8788
for (auto *runtime : process_sp->GetLanguageRuntimes()) {
88-
if (runtime->IsSymbolARuntimeThunk(*symbol)) {
89+
if (runtime->IsSymbolARuntimeThunk(*symbol) &&
90+
flags.Test(ThreadPlanShouldStopHere::eStepOutPastThunks)) {
91+
LLDB_LOGF(
92+
log, "Stepping out past a language thunk %s for: %s",
93+
frame->GetFunctionName(),
94+
Language::GetNameForLanguageType(runtime->GetLanguageType()));
8995
should_stop_here = false;
9096
break;
9197
}
@@ -140,9 +146,12 @@ ThreadPlanSP ThreadPlanShouldStopHere::DefaultStepFromHereCallback(
140146
// because it's marked line 0.
141147
bool is_thunk = false;
142148
for (auto *runtime : process_sp->GetLanguageRuntimes()) {
143-
if (runtime->IsSymbolARuntimeThunk(*sc.symbol)) {
144-
LLDB_LOGF(log, "In runtime thunk %s - stepping out.",
145-
sc.symbol->GetName().GetCString());
149+
if (runtime->IsSymbolARuntimeThunk(*sc.symbol) &&
150+
flags.Test(ThreadPlanShouldStopHere::eStepOutPastThunks)) {
151+
LLDB_LOGF(
152+
log, "Stepping out past a language thunk %s for: %s",
153+
frame->GetFunctionName(),
154+
Language::GetNameForLanguageType(runtime->GetLanguageType()));
146155
is_thunk = true;
147156
break;
148157
}

lldb/source/Target/ThreadPlanStepInRange.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ using namespace lldb;
2929
using namespace lldb_private;
3030

3131
uint32_t ThreadPlanStepInRange::s_default_flag_values =
32-
ThreadPlanShouldStopHere::eStepInAvoidNoDebug;
32+
ThreadPlanShouldStopHere::eStepInAvoidNoDebug |
33+
ThreadPlanShouldStopHere::eStepOutPastThunks;
3334

3435
// ThreadPlanStepInRange: Step through a stack range, either stepping over or
3536
// into based on the value of \a type.

0 commit comments

Comments
 (0)