[PATCH] D142283: [Support] Make llvm-symbolizer runs for stack traces work on Apple platforms

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 11:11:05 PST 2023


aprantl added inline comments.


================
Comment at: llvm/lib/Support/Signals.cpp:227
+        Args.push_back("--dsym-hint");
+        Args.push_back(DSymHintArgs.back());
+      }
----------------
dblaikie wrote:
> aprantl wrote:
> > aprantl wrote:
> > > dblaikie wrote:
> > > > aprantl wrote:
> > > > > The correct way of locating dSYMs on macOS is to run `mdfind` with the UUID of binary (e.g., https://github.com/llvm/llvm-project/blob/b40bfc1b9e389c154f6c60550dfc010ff8b3658f/lldb/examples/python/crashlog.py#L303).  The UUID can be extracted with `dwarfdump --uuid` for example.
> > > > Does that cover the non-dsym case (debugging/symbolizing from raw .o files) too?
> > > No, this is strictly for finding .dSYM bundles. The official way of symbolicating on macOS is to use the CoreSymbolication framework which hides all these details and is exposed through tools like `atos`. (That's how the sanitizer runtime does it for example). The other option is to call into LLDB.framework using its public API, but that needs developer tools to be installed on the system.
> > https://lldb.llvm.org/use/symbolication.html
> > https://lldb.llvm.org/use/symbols.html
> > 
> > So technically in addition to running mdfind you'd then also need to run any script in `com.apple.DebugSymbols.DBGShellCommands` ...
> ah, should we just not make llvm-symbolizer work on macos, then? Should llvm use `atos` for symbolizing on macoS?
I'm not familiar with llvm-symbolizer and how it's meant to be used. For symbolizing addresses in other Darwin process, I think just having llvm-symbolizer forward to `atos` would be the most future-proof and compatible implementation. But if you use it to e.g., symbolize macOS crashlogs on a Linux server then that would not be an option.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142283/new/

https://reviews.llvm.org/D142283



More information about the llvm-commits mailing list