[PATCH] D85458: Adding functionality to Stack Tracing

Dibya Ranjan Mishra via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 09:34:25 PDT 2020


dibya001 added a comment.

In D85458#2210475 <https://reviews.llvm.org/D85458#2210475>, @aganea wrote:

> Change LGTM, do you have commit access? You should perhaps request it if you're planning on further patches.
> No, I dont have access as of now.
>
> In D85458#2210411 <https://reviews.llvm.org/D85458#2210411>, @dibya001 wrote:
>
>> In some cases we would like to show just the call stack of the llvm pass that crashed, and not the complete call stack of the application which could be very big.
>
> How do you decide on the depth of the callstack? Depending on where the crash occurs, the pass entry (runOnFunction) could be at different depth? How do you handle that?
> So from the caller function, I would store the stack_trace depth value from the backtrace function. let's say the value is x1 and when the crash happens., in the signal/crash handler, I would get the depth at the postiton(let's say the value is x2). So in the PrintStackTrace() func I will pass the depth as x2-x1+1
>
>> And also "optionally" print other information for better diagnostics when the crash happens
>
> Ah yes, that would be really nice. You mean adding more `llvm::PrettyStackTraceEntry` contexts?

Yes. Or in a simple case, we could print using the PrettyStackTraceProgram-print() function.


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

https://reviews.llvm.org/D85458



More information about the llvm-commits mailing list