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

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 11:05:28 PST 2023


mehdi_amini 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:
> > 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.
> *nod* If the goal is cross-platform, then we'd need some more explicit contract about how to find debug info (both .o and dsym) than "ask atos".
> 
> Yeah, guess it depends what folks goals are
While llvm-symbolizer is likely intended to work in a cross-platform way, the signal handler here is in-process and not concerned by this right?

If so, we should be fine with just invoking `atos` **instead** of `llvm-symbolizer` here, shouldn't we?


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