[Lldb-commits] [lldb] Don't search for separate debug files for mach-o object files (PR #81041)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Feb 7 14:18:42 PST 2024
https://github.com/jimingham updated https://github.com/llvm/llvm-project/pull/81041
>From 787d48cd3e2af5478f05986268e91d1bfb5a4c30 Mon Sep 17 00:00:00 2001
From: Jim Ingham <jingham at apple.com>
Date: Wed, 7 Feb 2024 13:00:55 -0800
Subject: [PATCH 1/2] Don't search for separate debug files for mach-o object
files
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.
---
.../Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
index 47fe0020ce18de..4080a31224a417 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();
>From b2e7c7e8b342e13b457dcf7da40040f2373c7a3d Mon Sep 17 00:00:00 2001
From: Jim Ingham <jingham at apple.com>
Date: Wed, 7 Feb 2024 14:16:47 -0800
Subject: [PATCH 2/2] Format futzing
---
.../source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
index 4080a31224a417..f46bff8f7d12e3 100644
--- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
+++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
@@ -123,8 +123,8 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
// 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) {
+ 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();
More information about the lldb-commits
mailing list