[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 16 13:18:07 PDT 2021


teemperor requested changes to this revision.
teemperor added a comment.
This revision now requires changes to proceed.
Herald added a subscriber: JDevlieghere.

Could you add a test for that? The usual test fixit in Clang is `.`/`->` mixup, e.g.

  (lldb) expr struct Foo { int i; }; Foo *f; f.i ; unknown_identifier_for_fatal_error
  (int) $0 = 0
    Fix-it applied, fixed expression was: 
      struct Foo { int i; }; Foo *f; f->i ; unknown_identifier_for_fatal_error
  ...

I think this patch also needs to update `UserExpression::Evaluate` which, IIRC, is clearing the fixed expression when it fails to parse.

The direction of the patch is IMHO fine. One thing that would be nice is to see if we could maybe preserve the Fix-It diagnostics from the original expression. If we just return whatever the fixed expression fails with then it's not clear why the compiler actually generated a Fix-It. But that's more of a nice-to-have I think.


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