[Lldb-commits] [lldb] Add --copyExecutable and --ignoreNegativeCache to dsymForUUID invoke (PR #72579)

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 16 14:24:10 PST 2023


https://github.com/jasonmolenda created https://github.com/llvm/llvm-project/pull/72579

On macOS lldb normally goes through the DebugSymbols framework to find dSYMs -- by spotlight search on the local computer, or specially laid out directories, or possibly calling a program which can download the dSYM and/or executable to the local computer and return paths to those in a plist (xml).  For certain special debug scenarios, we have an additional mechanism where we force a download if we have a local utility, instead of making the user enable expensive downloads for all binaries in all debug sessions.

This is all done in SymbolLocatorDebugSymbols::DownloadObjectAndSymbolFile where we invoke this dsymForUUID utility with --copyExecutable and --ignoreNegativeCache.  This patch updates crashlog.py to invoke this utility the same way if it is available.

rdar://118480731 

>From 0b2c3c09f8049cc111ad5de071337872f355dd31 Mon Sep 17 00:00:00 2001
From: Jason Molenda <jmolenda at apple.com>
Date: Thu, 16 Nov 2023 14:02:01 -0800
Subject: [PATCH] Add --copyExecutable and --ignoreNegativeCache to dsymForUUID
 invoke

On macOS lldb normally goes through the DebugSymbols framework to
find dSYMs -- by spotlight search on the local computer, or specially
laid out directories, or possibly calling a program which can
download the dSYM and/or executable to the local computer and return
paths to those in a plist (xml).  For certain special debug scenarios,
we have an additional mechanism where we force a download if we have
a local utility, instead of making the user enable expensive downloads
for all binaries in all debug sessions.

This is all done in SymbolLocatorDebugSymbols::DownloadObjectAndSymbolFile
where we invoke this dsymForUUID utility with --copyExecutable and
--ignoreNegativeCache.  This patch updates crashlog.py to invoke
this utility the same way if it is available.
---
 lldb/examples/python/crashlog.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index cb8008419404c23..97649bb677cb1f8 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -356,7 +356,10 @@ def locate_module_and_debug_symbols(self):
             # Keep track of unresolved source paths.
             unavailable_source_paths = set()
             if os.path.exists(self.dsymForUUIDBinary):
-                dsym_for_uuid_command = "%s %s" % (self.dsymForUUIDBinary, uuid_str)
+                dsym_for_uuid_command = (
+                    "%s --copyExecutable --ignoreNegativeCache %s"
+                    % (self.dsymForUUIDBinary, uuid_str)
+                )
                 s = subprocess.check_output(dsym_for_uuid_command, shell=True)
                 if s:
                     try:



More information about the lldb-commits mailing list