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

via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 29 13:23:37 PDT 2024


Author: Zequan Wu
Date: 2024-10-29T16:23:33-04:00
New Revision: 8193832fb988e3df1e8e726634783805dca8d9b6

URL: https://github.com/llvm/llvm-project/commit/8193832fb988e3df1e8e726634783805dca8d9b6
DIFF: https://github.com/llvm/llvm-project/commit/8193832fb988e3df1e8e726634783805dca8d9b6.diff

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

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.

Added: 
    

Modified: 
    lldb/source/Core/SourceManager.cpp

Removed: 
    


################################################################################
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) {


        


More information about the lldb-commits mailing list