[Lldb-commits] [PATCH] D157160: Surface error messages from the DebugSymbols DBGShellCommands external agent; add logging for LC_NOTEs in Mach-O corefiles

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 4 16:46:52 PDT 2023


jasonmolenda created this revision.
jasonmolenda added a reviewer: bulbazord.
jasonmolenda added a project: LLDB.
Herald added a subscriber: JDevlieghere.
Herald added a project: All.
jasonmolenda requested review of this revision.
Herald added a subscriber: lldb-commits.

On Darwin systems, lldb will call into the DebugSymbols framework to find the debug info (and/or binary) for a given UUID.  The user may have set a DBGShellCommands preference in com.apple.DebugSymbols to find that binary by UUID.  lldb will also try a binary that is set in the env var LLDB_APPLE_DSYMFORUUID_EXECUTABLE (mostly used by the testsuite) and for certain "force a binary load" binaries (e.g. the Darwin kernel binary/symbols, without which kernel debugging is largely useless), we have a special case in source/Symbol/LocateSymbolFileMacOSX.cpp that knows about a binary called /usr/local/bin/dsymForUUID that may be installed.

These DBGShellCommands programs return a plist (xml) output giving lldb the location of the dSYM and/or binary.  They can also return an error message in that xml response.  Today lldb does not print that error, making it difficult for users to understand why a binary was not successfully loaded.

I also added some simple logging as lldb processes LC_NOTEs in a mach-o corefile binary that can be enabled, to understand what lldb is seeing as it loads one of these.

I have another patch that I'll be uploading soon where I fix the DBGError return from a test case TestMultipleBinaryCorefile.py, although the error message is sent to the Debugger's Stdout channel so I'm not capturing/testing it in the API test right now.  (the dsym-for-uuid.sh that this test case creates DOES emit a DBGError right now on an unknown uuid, but it doesn't format it correctly and lldb ignores it).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157160

Files:
  lldb/source/Core/DynamicLoader.cpp
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157160.547402.patch
Type: text/x-patch
Size: 11011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230804/6b5f08b3/attachment-0001.bin>


More information about the lldb-commits mailing list