This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Don't print IRForTarget errors directly to the console
ClosedPublic

Authored by teemperor on Jun 11 2020, 7:11 AM.

Details

Summary

When we get an error back from IRForTarget we directly print that error to the debugger output
stream instead of putting it in the result object. The result object only gets a vague
"The expression could not be prepared to run in the target" error message that doesn't actually
tell the user what went wrong.

This patch just puts the IRForTarget errors into the status object that is returned to the caller instead
of directly printing it to the debugger. Also updates one test that now can actually check
for the error message it is supposed to check for (instead of the default error which is all we had before).

Diff Detail

Event Timeline

teemperor created this revision.Jun 11 2020, 7:11 AM
JDevlieghere accepted this revision.Jun 11 2020, 11:12 AM

Nice

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
1330–1331

Drive-by nit: the value doesn't seem used anywhere else and the variable name doesn't add a lot of value, so I'd rewrite this as:

if (!ir_for_target.runOnModule(*execution_unit_sp->GetModule())) {
  ..
}
This revision is now accepted and ready to land.Jun 11 2020, 11:12 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2020, 1:35 AM