Skip to content

Commit 50ffc53

Browse files
authored
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.
1 parent d05bd34 commit 50ffc53

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
118118
FileSpec dsym_fspec(module_sp->GetSymbolFileFileSpec());
119119

120120
ObjectFileSP dsym_objfile_sp;
121-
if (!dsym_fspec) {
121+
// On Darwin, we store the debug information either in object files,
122+
// using the debug map to tie them to the executable, or in a dSYM. We
123+
// pass through this routine both for binaries and for .o files, but in the
124+
// latter case there will never be an external debug file. So we shouldn't
125+
// do all the stats needed to find it.
126+
if (!dsym_fspec && module_sp->GetObjectFile()->CalculateType() !=
127+
ObjectFile::eTypeObjectFile) {
122128
// No symbol file was specified in the module, lets try and find one
123129
// ourselves.
124130
FileSpec file_spec = obj_file->GetFileSpec();

0 commit comments

Comments
 (0)