Skip to content

Add --copyExecutable and --ignoreNegativeCache to dsymForUUID invoke #72579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jasonmolenda
Copy link
Collaborator

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

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.
@llvmbot
Copy link
Member

llvmbot commented Nov 16, 2023

@llvm/pr-subscribers-lldb

Author: Jason Molenda (jasonmolenda)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/72579.diff

1 Files Affected:

  • (modified) lldb/examples/python/crashlog.py (+4-1)
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:

Copy link
Member

@bulbazord bulbazord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@medismailben
Copy link
Member

Seems to have been resolved in #72669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants