Page MenuHomePhabricator

Propagate command interpreter errors from lldlbinit
ClosedPublic

Authored by JDevlieghere on May 5 2019, 7:32 PM.

Details

Summary

This patch ensures that we propagate errors coming from the lldbinit file trough the command/script interpreter. Before, if you did something like command script import syntax_error.py, and the python file contained a syntax error, lldb wouldn't tell you about it. This changes with the current patch: errors are now propagated by default.

PS: Jim authored this change and I added testing.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

JDevlieghere created this revision.May 5 2019, 7:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2019, 7:32 PM
Herald added a subscriber: abidh. · View Herald Transcript

I wonder if it would make this a little more convenient if we added a SetNoisy as the opposite of SetSilent?

aprantl accepted this revision.May 7 2019, 3:10 PM

Seems plausible.

lldb/source/Interpreter/CommandInterpreter.cpp
2472 ↗(On Diff #198215)

Is m_command_source_flags.empty() || Flags(m_command_source_flags.back()).Test(eHandleCommandFlagPrintErrors) better? Not sure.

This revision is now accepted and ready to land.May 7 2019, 3:10 PM
JDevlieghere marked an inline comment as done.May 7 2019, 3:27 PM
JDevlieghere added inline comments.
lldb/source/Interpreter/CommandInterpreter.cpp
2472 ↗(On Diff #198215)

Personally I think this is easier to read, and consistent with what we do elsewhere. Happy to be convinced otherwise though :-)

jingham added inline comments.May 7 2019, 3:36 PM
lldb/source/Interpreter/CommandInterpreter.cpp
2472 ↗(On Diff #198215)

I agree with Jonas, the original is easier to read.

This revision was automatically updated to reflect the committed changes.