diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp index b3360dbf6158a..64bc5323fc4e6 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp @@ -488,7 +488,7 @@ DynamicLoaderPOSIXDYLD::GetStepThroughTrampolinePlan(Thread &thread, if (sym == nullptr || !sym->IsTrampoline()) return thread_plan_sp; - ConstString sym_name = sym->GetName(); + ConstString sym_name = sym->GetMangled().GetName(Mangled::ePreferMangled); if (!sym_name) return thread_plan_sp; diff --git a/lldb/test/API/lang/cpp/step-through-trampoline/Makefile b/lldb/test/API/lang/cpp/step-through-trampoline/Makefile new file mode 100644 index 0000000000000..624021fbe98d6 --- /dev/null +++ b/lldb/test/API/lang/cpp/step-through-trampoline/Makefile @@ -0,0 +1,6 @@ +DYLIB_NAME := foo +DYLIB_CXX_SOURCES := foo.cpp +CXX_SOURCES := main.cpp + +include Makefile.rules + diff --git a/lldb/test/API/lang/cpp/step-through-trampoline/TestStepThroughTrampoline.py b/lldb/test/API/lang/cpp/step-through-trampoline/TestStepThroughTrampoline.py new file mode 100644 index 0000000000000..b6384c73306ab --- /dev/null +++ b/lldb/test/API/lang/cpp/step-through-trampoline/TestStepThroughTrampoline.py @@ -0,0 +1,17 @@ +import lldb +from lldbsuite.test.lldbtest import * +import lldbsuite.test.lldbutil as lldbutil + +class StepThroughTrampoline(TestBase): + mydir = TestBase.compute_mydir(__file__) + + def test(self): + self.build() + (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self, + "// Set a breakpoint here", + lldb.SBFileSpec("main.cpp"), + extra_images=["foo"]) + thread.StepInto() + + foo_line = line_number("foo.cpp", '// End up here') + self.expect("frame info", substrs=["foo.cpp:{}:".format(foo_line)]) diff --git a/lldb/test/API/lang/cpp/step-through-trampoline/foo.cpp b/lldb/test/API/lang/cpp/step-through-trampoline/foo.cpp new file mode 100644 index 0000000000000..8faa4b65c8068 --- /dev/null +++ b/lldb/test/API/lang/cpp/step-through-trampoline/foo.cpp @@ -0,0 +1,4 @@ +#include "foo.h" + +void foo() { } // End up here + diff --git a/lldb/test/API/lang/cpp/step-through-trampoline/foo.h b/lldb/test/API/lang/cpp/step-through-trampoline/foo.h new file mode 100644 index 0000000000000..edfeae5a215f3 --- /dev/null +++ b/lldb/test/API/lang/cpp/step-through-trampoline/foo.h @@ -0,0 +1,2 @@ +extern void foo(); + diff --git a/lldb/test/API/lang/cpp/step-through-trampoline/main.cpp b/lldb/test/API/lang/cpp/step-through-trampoline/main.cpp new file mode 100644 index 0000000000000..3896e71f860a9 --- /dev/null +++ b/lldb/test/API/lang/cpp/step-through-trampoline/main.cpp @@ -0,0 +1,6 @@ +#include "foo.h" + +int main(void) { + foo(); // Set a breakpoint here +} +