Skip to content

Commit a02a623

Browse files
committed
Address comments
1 parent c272d51 commit a02a623

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

libcxx/docs/UserDocumentation.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,10 @@ To also show those implementation details, use ``thread backtrace -u``.
371371
Alternatively, to disable those compact backtraces, use ``frame recognizer list``
372372
and ``frame recognizer disable`` on the "libc++ frame recognizer".
373373

374+
Futhermore, stepping into libc++ functions is disabled by default. This is controlled via the
375+
setting ``target.process.thread.step-avoid-regexp`` which defaults to ``^std::`` and can be
376+
disabled using ``settings set target.process.thread.step-avoid-regexp ""``.
377+
374378
GDB Pretty printers for libc++
375379
------------------------------
376380

lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,26 @@ class LibCXXFrameRecognizer : public StackFrameRecognizer {
8181

8282
// Check if we have a regex match
8383
bool matches_regex = false;
84-
for (RegularExpression &r : m_hidden_regex)
84+
for (RegularExpression &r : m_hidden_regex) {
8585
if (r.Execute(sc.function->GetNameNoArguments())) {
8686
matches_regex = true;
8787
break;
8888
}
89+
}
8990

9091
if (matches_regex) {
9192
// Only hide this frame if the immediate caller is also within libc++.
92-
lldb::StackFrameSP parent_frame =
93-
frame_sp->GetThread()->GetStackFrameAtIndex(
93+
lldb::ThreadSP thread_sp = frame_sp->GetThread();
94+
if (!thread_sp)
95+
return {};
96+
lldb::StackFrameSP parent_frame_sp = thread_sp->GetStackFrameAtIndex(
9497
frame_sp->GetFrameIndex() + 1);
98+
if (!parent_frame_sp)
99+
return {};
95100
const auto &parent_sc =
96-
parent_frame->GetSymbolContext(lldb::eSymbolContextFunction);
101+
parent_frame_sp->GetSymbolContext(lldb::eSymbolContextFunction);
102+
if (!parent_sc.function)
103+
return {};
97104
if (parent_sc.function->GetNameNoArguments().GetStringRef().starts_with(
98105
"std::")) {
99106
return m_hidden_frame;

0 commit comments

Comments
 (0)