[Lldb-commits] [lldb] [lldb] Search main function with lldb::eFunctionNameTypeFull when getting default file and line. (PR #113980)

via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 28 16:52:28 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Zequan Wu (ZequanWu)

<details>
<summary>Changes</summary>

This is to work around the fact that `SymbolFileNativePDB::FindFunctions` only support `lldb::eFunctionNameTypeFull` and `lldb::eFunctionNameTypeMethod` now. Since `main`'s full name is the same as base name (`main`), it's okay to search with `lldb::eFunctionNameTypeFull` when trying to get the default file and line. With this, `lldb/test/Shell/Driver/TestSingleQuote.test` passes on Windows with NativePDB plugin.

---
Full diff: https://github.com/llvm/llvm-project/pull/113980.diff


1 Files Affected:

- (modified) lldb/source/Core/SourceManager.cpp (+1-1) 


``````````diff
diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp
index fd5b49946c6a92..27a9edeef4249e 100644
--- a/lldb/source/Core/SourceManager.cpp
+++ b/lldb/source/Core/SourceManager.cpp
@@ -430,7 +430,7 @@ SourceManager::GetDefaultFileAndLine() {
             false; // Force it to be a debug symbol.
         function_options.include_inlines = true;
         executable_ptr->FindFunctions(main_name, CompilerDeclContext(),
-                                      lldb::eFunctionNameTypeBase,
+                                      lldb::eFunctionNameTypeFull,
                                       function_options, sc_list);
         for (const SymbolContext &sc : sc_list) {
           if (sc.function) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/113980


More information about the lldb-commits mailing list