Small debugging utility to stop immediately when an Error occurs and not only in abort() far up the stack.
Enable/disable in your debug session with one of these:
(lldb) expr BreakOnError = true (lldb) expr llvm::Error::BreakOnError = true
Differential D51138
[Error] Add runtime flag BreakOnError and a debug trap in the Error class sgraenitz on Aug 22 2018, 3:51 PM. Authored by
Details
Small debugging utility to stop immediately when an Error occurs and not only in abort() far up the stack. (lldb) expr BreakOnError = true (lldb) expr llvm::Error::BreakOnError = true
Diff Detail
Event TimelineComment Actions Hi Stefan, I usually find it better to put a breakpoint on the ErrorInfoBase constructor: that way you don't hit breakpoints when errors are just passed around. Would using a breakpoint on ErrorInfoBase address your use case? Comment Actions Hi Lang, thanks for your feedback. Very good point. Changed that! The additional static variable is not considered ABI-breaking right? Comment Actions In fact, (lldb) b ErrorInfoBase::ErrorInfoBase is just as good and doesn't need any code change. Is it documented somewhere? Comment Actions Hi Stefan,
No, it would not be.
No, I do not think it is. That would be a good tip to add to the programmer's manual. |