[lldb-dev] Hiding trampoline functions from the backtrace, is it possible ?
Nat! via lldb-dev
lldb-dev at lists.llvm.org
Mon Sep 23 15:28:22 PDT 2019
On 23.09.19 19:22, Adrian Prantl wrote:
> I think the best mechanism for this would be to ensure that the trampolines are marked up as DW_AT_artificial and/or DW_AT_trampoline by the compiler. I'm pretty sure LLDB then already knows how to hide artificial frames (somebody else can probably provide pointers for how that works).
> -- adrian
That's a good idea. I can just put __attribute__((artificial)__ on my
dispatch functions. That's the low-hanging-fruit code I like :)
And though it might not fully work yet with lldb , it may in the future.
On 23.09.19 20:36, Jim Ingham wrote:
> lldb can step through trampolines (and step back out again in some cases). But there isn't any support for suppressing the printing of frames.
> One way to add this is to use the "Frame Recognizers" Kuba added to lldb recently. The use he had for them was to produce artificial variables for frames you don't have debug information for. But one of the other jobs I had envisioned for frame recognizers was to mark frames as uninteresting for printing. Then you could hook up "bt" to suppress frames that the recognizer marked this way. Since you can add recognizers in Python, this is a fairly attractive way to go, since people could adjust their printing to suppress frames not interesting to them. And of course, as Adrian suggested, recognizers could consult the debug info as well to suppress DW_AT_artificial and DW_AT_trampoline.
Ha. Having to deal additionally with python is not what I call
Thanks for those reponses. Very helpful.
More information about the lldb-dev