Author: Alex Langford
Date: 2026-01-09T13:50:56-08:00
New Revision: 54840055b884031330108e66c019873029591a78

URL: 
https://github.com/llvm/llvm-project/commit/54840055b884031330108e66c019873029591a78
DIFF: 
https://github.com/llvm/llvm-project/commit/54840055b884031330108e66c019873029591a78.diff

LOG: [lldb] Fix TestMultithreaded.py when libc++ symbols are present (#174664)

There are a few test cases in TestMultithreaded.py. Most of them set a
breakpoint by name on "next". There's no problem with doing that, but
one of the tests cases in particular relies on being able to grab a
specific breakpoint location corresponding to the test inferior.

If you have libc++ symbols, this test will also have breakpoint
locations for symbols named `next` in libc++. I could have changed the
test to find the correct `next` breakpoint location, but it seems easier
to give it a more uncommon name instead.

Added: 
    

Modified: 
    lldb/test/API/api/multithreaded/inferior.cpp
    
lldb/test/API/api/multithreaded/test_breakpoint_location_callback.cpp.template

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/api/multithreaded/inferior.cpp 
b/lldb/test/API/api/multithreaded/inferior.cpp
index 3755bdd04f880..1997b783469ab 100644
--- a/lldb/test/API/api/multithreaded/inferior.cpp
+++ b/lldb/test/API/api/multithreaded/inferior.cpp
@@ -1,8 +1,6 @@
 
 #include <iostream>
 
-
-
 int next() {
   static int i = 0;
   std::cout << "incrementing " << i << std::endl;

diff  --git 
a/lldb/test/API/api/multithreaded/test_breakpoint_location_callback.cpp.template
 
b/lldb/test/API/api/multithreaded/test_breakpoint_location_callback.cpp.template
index 0b0dc5652e850..a4bc65ab91331 100644
--- 
a/lldb/test/API/api/multithreaded/test_breakpoint_location_callback.cpp.template
+++ 
b/lldb/test/API/api/multithreaded/test_breakpoint_location_callback.cpp.template
@@ -33,7 +33,13 @@ void test(SBDebugger &dbg, vector<string> args) {
   SBTarget target = dbg.CreateTarget(args.at(0).c_str());
   if (!target.IsValid()) throw Exception("invalid target");
 
-  SBBreakpoint breakpoint = target.BreakpointCreateByName("next");
+  // Only look for the breakpoint in the main module.
+  SBFileSpec main_module(args.at(0).c_str(), /*resolve=*/true);
+  SBFileSpecList module_list;
+  module_list.Append(main_module);
+
+  SBBreakpoint breakpoint = target.BreakpointCreateByName(
+      "next", eFunctionNameTypeFull, module_list, SBFileSpecList());
   if (!breakpoint.IsValid()) throw Exception("invalid breakpoint");
 
   if(breakpoint.GetNumLocations() != 1) throw Exception("unexpected amount of 
breakpoint locations");


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to