[Lldb-commits] [PATCH] D109908: [lldb] Show fix-it applied even if expression didn't evaluate succesfully
Raphael Isemann via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Sep 23 10:07:54 PDT 2021
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.
My bad, I thought you wanted to print the fix-its if the 'fixed' expression failed to *parse* again, but this is about non-parsing errors. Ignore my other points, they were suggestions how to implemented what I thought this is about.
LGTM now. Just have some nits about the test but those don't need another round of review. Thanks for fixing this!
================
Comment at: lldb/test/API/commands/expression/fixits/TestFixIts.py:86
+ def test_with_target_error_applies_fixit(self):
+ """ Check that applying a Fix-it which fails to execute correctly still
+ prints that the Fix-it was applied. """
----------------
Trailing white space here.
================
Comment at: lldb/test/API/commands/expression/fixits/TestFixIts.py:96
+ result = self.dbg.GetCommandInterpreter().HandleCommand("expression null_pointer.first", ret_val)
+ self.assertEqual(result, lldb.eReturnStatusFailed, ret_val.GetError())
+
----------------
I think you meant `ret_val.GetOutput()` here as message gets printed if `result != eReturnStatusFailed`?
I anyway think you can just minimize everything from line 94 onwards with the normal `expect` routine:
```
lang=python
self.expect("expression -- null_pointer.first", error=True, substrs=[
"Fix-it applied, fixed expression was:", "null_pointer->first"])
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109908/new/
https://reviews.llvm.org/D109908
More information about the lldb-commits
mailing list