Author: jimingham
Date: 2024-02-07T14:25:51-08:00
New Revision: 50ffc53e4708f3484939ef82e7b0309600a8e19f

URL: 
https://github.com/llvm/llvm-project/commit/50ffc53e4708f3484939ef82e7b0309600a8e19f
DIFF: 
https://github.com/llvm/llvm-project/commit/50ffc53e4708f3484939ef82e7b0309600a8e19f.diff

LOG: Don't search for separate debug files for mach-o object files (#81041)

mach-o object files never have separate debug info, and in a big app
there can be quite a large number of object files, so even a few stats
per object file can slow launches considerably.
This patch avoids this search for Mach-o symbol files of object type.

I don't have a way to test this, the only effect is that you didn't do a
bunch of stats that weren't going to do any good anyway.

Added: 
    

Modified: 
    lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp 
b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
index 47fe0020ce18de..f46bff8f7d12e3 100644
--- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
+++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
@@ -118,7 +118,13 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP 
&module_sp,
     FileSpec dsym_fspec(module_sp->GetSymbolFileFileSpec());
 
     ObjectFileSP dsym_objfile_sp;
-    if (!dsym_fspec) {
+    // On Darwin, we store the debug information either in object files,
+    // using the debug map to tie them to the executable, or in a dSYM.  We
+    // pass through this routine both for binaries and for .o files, but in the
+    // latter case there will never be an external debug file.  So we shouldn't
+    // do all the stats needed to find it.
+    if (!dsym_fspec && module_sp->GetObjectFile()->CalculateType() !=
+        ObjectFile::eTypeObjectFile) {
       // No symbol file was specified in the module, lets try and find one
       // ourselves.
       FileSpec file_spec = obj_file->GetFileSpec();


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to