Author: rchamala
Date: 2026-02-14T17:04:38Z
New Revision: 945db339632895e18721882b0a71e9d41d9c4ef7

URL: 
https://github.com/llvm/llvm-project/commit/945db339632895e18721882b0a71e9d41d9c4ef7
DIFF: 
https://github.com/llvm/llvm-project/commit/945db339632895e18721882b0a71e9d41d9c4ef7.diff

LOG: [lldb] Fix Windows build and remote test failure for ScriptedSymbolLocator 
(#181488)

## Summary
- Move `GetScriptedSymbolLocatorClassName()` from inline in `Target.h`
to out-of-line in `Target.cpp` to avoid collision with Windows
`winuser.h` `#define GetClassName GetClassNameW` macro.
- Replace `LaunchSimple(None, None, os.getcwd())` with
`lldbutil.run_to_breakpoint_do_run()` in `test_locate_source_file` to
fix test failure on remote platforms where the local working directory
doesn't exist.

Fixes CI failures from #181334.

## Test plan
- [ ] Windows (aarch64-windows) build passes
- [ ] remote-linux-win test passes
- [ ] Existing ScriptedSymbolLocator tests pass on local platforms

Co-authored-by: Rahul Reddy Chamala <[email protected]>

Added: 
    

Modified: 
    lldb/include/lldb/Target/Target.h
    lldb/source/Target/Target.cpp
    
lldb/test/API/functionalities/scripted_symbol_locator/TestScriptedSymbolLocator.py

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Target/Target.h 
b/lldb/include/lldb/Target/Target.h
index b51d49f2f780d..75e9f691b6382 100644
--- a/lldb/include/lldb/Target/Target.h
+++ b/lldb/include/lldb/Target/Target.h
@@ -1712,11 +1712,7 @@ class Target : public 
std::enable_shared_from_this<Target>,
                                        StructuredData::DictionarySP args_sp);
   void ClearScriptedSymbolLocator();
   lldb::ScriptedSymbolLocatorInterfaceSP GetScriptedSymbolLocatorInterface();
-  llvm::StringRef GetScriptedSymbolLocatorClassName() const {
-    return m_scripted_symbol_locator_metadata_sp
-               ? m_scripted_symbol_locator_metadata_sp->GetClassName()
-               : "";
-  }
+  llvm::StringRef GetScriptedSymbolLocatorClassName() const;
 
   /// Look up a previously cached source file resolution result.
   /// Returns true if a cached entry exists (even if the result is nullopt).

diff  --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index be22e174bfbc2..ca2e5a6b5679c 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -3493,6 +3493,12 @@ ScriptedSymbolLocatorInterfaceSP 
Target::GetScriptedSymbolLocatorInterface() {
   return m_scripted_symbol_locator_interface_sp;
 }
 
+llvm::StringRef Target::GetScriptedSymbolLocatorClassName() const {
+  return m_scripted_symbol_locator_metadata_sp
+             ? m_scripted_symbol_locator_metadata_sp->GetClassName()
+             : "";
+}
+
 bool Target::LookupScriptedSourceFileCache(
     llvm::StringRef key, std::optional<FileSpec> &result) const {
   auto it = m_scripted_source_file_cache.find(key);

diff  --git 
a/lldb/test/API/functionalities/scripted_symbol_locator/TestScriptedSymbolLocator.py
 
b/lldb/test/API/functionalities/scripted_symbol_locator/TestScriptedSymbolLocator.py
index 8fdad934de502..7ba920a9772c8 100644
--- 
a/lldb/test/API/functionalities/scripted_symbol_locator/TestScriptedSymbolLocator.py
+++ 
b/lldb/test/API/functionalities/scripted_symbol_locator/TestScriptedSymbolLocator.py
@@ -70,11 +70,9 @@ def test_locate_source_file(self):
 
         # Launch and stop at the breakpoint so ApplyFileMappings runs on
         # the main thread via StackFrame::GetSymbolContext.
-        process = target.LaunchSimple(None, None, os.getcwd())
-        self.assertIsNotNone(process)
-        self.assertState(process.GetState(), lldb.eStateStopped)
-
-        thread = process.GetSelectedThread()
+        (target, process, thread, bkpt) = lldbutil.run_to_breakpoint_do_run(
+            self, target, bp
+        )
         frame = thread.GetSelectedFrame()
         line_entry = frame.GetLineEntry()
         self.assertTrue(line_entry and line_entry.IsValid(), "Line entry is 
valid")


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

Reply via email to