[lldb] Make expect_expr fall back to the dummy target if no target is selected
authorRaphael Isemann <teemperor@gmail.com>
Wed, 15 Jul 2020 11:55:32 +0000 (13:55 +0200)
committerRaphael Isemann <teemperor@gmail.com>
Wed, 15 Jul 2020 11:56:00 +0000 (13:56 +0200)
commit10fd550d308d5dbcf7a3068f1f76d5f0f1a56661
treec350d25432eb00725684e12fc1388afe20730049
parent29aab9b5c748b28b231e2ca0f9b95453638ade1a
[lldb] Make expect_expr fall back to the dummy target if no target is selected

Summary:

Currently expect_expr will not run the expression if no target is selected. This
patch changes this behavior so that expect_expr will instead fall back to the
dummy target similar to what the `expression` command is doing. This way we
don't have to compile an empty executable to be able to use `expect_expr` (which
is a waste of resources for tests that just test generic type system features).

As a test I modernized the TestTypeOfDeclTypeExpr into a Python test +
expect_expr (as it relied on the dummy target fallback of the expression
command).

Reviewers: labath, JDevlieghere

Reviewed By: labath

Subscribers: abidh

Differential Revision: https://reviews.llvm.org/D83388
lldb/packages/Python/lldbsuite/test/lldbtest.py
lldb/test/API/lang/cpp/typeof/TestTypeOfDeclTypeExpr.py [new file with mode: 0644]
lldb/test/Shell/Expr/TestTypeOfDeclTypeExpr.test [deleted file]