[lldb][expr] Propagate ClangDynamicCheckerFunctions::Install() errors to caller
authorStefan Gränitz <stefan.graenitz@gmail.com>
Tue, 21 Mar 2023 18:01:54 +0000 (19:01 +0100)
committerStefan Gränitz <stefan.graenitz@gmail.com>
Tue, 21 Mar 2023 18:05:23 +0000 (19:05 +0100)
commit32baf5c1c29b6b2f282354c9f5919865bc1ff958
tree3c1743978e8f47dfdb3b9def8a41d0204ae4e004
parentfa6ea7a419f37befbed04368bcb8af4c718facbb
[lldb][expr] Propagate ClangDynamicCheckerFunctions::Install() errors to caller

I came accross this, because a lot of regression tests were saying:
```
(lldb) p argc
error: expression failed to parse:
error: couldn't install checkers, unknown error
```

With this change, error messages provide more detail:
```
(lldb) p argc
error: expression failed to parse:
error: couldn't install checkers:
error: Couldn't lookup symbols:
  __objc_load
```

I didn't find a case where `Diagnostics()` is not empty. Also it looks like this isn't covered in any test (yet).

Reviewed By: bulbazord, Michael137

Differential Revision: https://reviews.llvm.org/D146541
lldb/include/lldb/Expression/DynamicCheckerFunctions.h
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
lldb/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp
lldb/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.h