[PATCH] D139750: Optionally print symbolizer markup backtraces.

Roland McGrath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 17 15:00:34 PDT 2023


mcgrathr added inline comments.


================
Comment at: llvm/lib/Support/Signals.cpp:271
+  for (int I = 0; I < Depth; I++)
+    OS << format("{{{bt:%d:%#016x}}}\n", I, StackTrace[I]);
+  return true;
----------------
mysterymath wrote:
> mcgrathr wrote:
> > Best format is to append `:ra` or `:pc` depending on whether it's a return-address or exact PC frame.
> > When it's from a crash, the first PC is an exact PC and usually others are return-address frames (though when using full CFI unwinding, individual frames might be exact PC frames).
> > 
> Unfortunately, the first PC will be well within the signal handler, so the source of the signal will be in some earlier frame. It seems difficult to find it, and separately difficult to tell whether it is a raise, direct function call, or a e.g. SIGSEGV. Accordingly, this seems like it would be a useful enhancement, but I'd expect it to be of a similar size to this patch.
The distinction is a feature of the unwinder semantics, not something you need to invent.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139750



More information about the llvm-commits mailing list