[Lldb-commits] [lldb] [lldb][SymbolFileDWARF] Don't search for DWP files on macOS (PR #139554)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Mon May 12 07:36:05 PDT 2025


https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/139554

A contrived performance measurement on my local machine:
1. Attach LLDB to LLDB
2. Measure how much time it takes to run `b operator[]`

Without this patch, we would spend a total of 400ms (which was ~4-5% of total execution) looking for DWP files (and failing to find them because they are not a concept on macOS).

We call into `GetDwpSymbolFile` via `DebugNamesDWARFIndex::GetFunctions -> ManualDWARFIndex::GetFunctions -> ManualDWARFIndex::Index`.

rdar://148212738

>From 17223e9ce0b95c112b18e6edfef5fee429ac6017 Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Mon, 12 May 2025 15:30:02 +0100
Subject: [PATCH] [lldb][SymbolFileDWARF] Don't search for DWP files on macOS

A contrived performance measurement on my local machine:
1. Attach LLDB to LLDB
2. Measure how much time it takes to run `b operator[]`

Without this patch, we would spend a total of 400ms (which was ~4-5% of
total execution) looking for DWP files (and failing to find them because
they are not a concept on macOS).

We call into `GetDwpSymbolFile` via `DebugNamesDWARFIndex::GetFunctions -> ManualDWARFIndex::GetFunctions -> ManualDWARFIndex::Index`.

rdar://148212738
---
 lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 907d63eb51afe..3f53e562ba65b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -4211,6 +4211,9 @@ SymbolFileDWARFDebugMap *SymbolFileDWARF::GetDebugMapSymfile() {
 
 const std::shared_ptr<SymbolFileDWARFDwo> &SymbolFileDWARF::GetDwpSymbolFile() {
   llvm::call_once(m_dwp_symfile_once_flag, [this]() {
+    if (m_objfile_sp->GetArchitecture().GetTriple().isAppleMachO())
+      return;
+
     // Create a list of files to try and append .dwp to.
     FileSpecList symfiles;
     // Append the module's object file path.



More information about the lldb-commits mailing list