Skip to content

Commit d3fa60c

Browse files
committed
Don't search for separate debug files for mach-o object files (llvm#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. (cherry picked from commit 50ffc53)
1 parent e8e5be8 commit d3fa60c

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
@@ -119,7 +119,13 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
119119
FileSpec dsym_fspec(module_sp->GetSymbolFileFileSpec());
120120

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

0 commit comments

Comments
 (0)