[Lldb-commits] [PATCH] D78825: [lldb/Driver] Exit with a non-zero exit code in batch mode when stopping because of an error.
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 27 09:06:44 PDT 2020
JDevlieghere marked an inline comment as done.
JDevlieghere added inline comments.
================
Comment at: lldb/source/API/SBDebugger.cpp:1205-1209
options.ref());
num_errors = interp.GetNumErrors();
quit_requested = interp.GetQuitRequested();
stopped_for_crash = interp.GetStoppedForCrash();
+ stopped_for_error = interp.GetStoppedForError();
----------------
labath wrote:
> What's the relationship between `num_errors` and `stopped_for_error`? Could we infer that we stopped because of an error if `num_errors>0` ?
I considered that, `m_num_errors` is incremented unconditionally, while stopped_for_error is only set when `eHandleCommandFlagStopOnError` is set. If you know that "stop on error" is set you could infer it based on the value being non-zero, but to me that sounds a bit fragile, and given that we already have `stopped_for_crash` I preferred the symmetry. I'm not married to this approach so if you feel strongly about it I'm happy to change it.
Repository:
rLLDB LLDB
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78825/new/
https://reviews.llvm.org/D78825
More information about the lldb-commits
mailing list