llvm-capstone/lldb/source/Expression
Raphael Isemann 71536fd031 [lldb] Fix that running a top level expression without a process fails with a cryptic error
Right now when running `expr --top-level -- void foo() {}`, LLDB just prints a cryptic
`error: Couldn't find $__lldb_expr() in the module` error. The reason for that is
that if we don't have a running process, we try to set our execution policy to always use the
IR interpreter (ExecutionPolicyNever) which works even without a process. However
that code didn't consider the special ExecutionPolicyTopLevel which we use for
top-level expressions. By changing the execution policy to ExecutionPolicyNever,
LLDB thinks we're actually trying to interpret a normal expression inside our
`$__lldb_expr` function and then fails when looking for it.

This just adds an exception for top-level expressions to that code and a bunch of tests.

Reviewed By: shafik

Differential Revision: https://reviews.llvm.org/D91723
2021-02-11 17:07:11 +01:00
..
CMakeLists.txt [CMake] Make intrinsics_gen dependency unconditional. 2020-07-17 16:43:17 -07:00
DiagnosticManager.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
DWARFExpression.cpp Diagnose unhandled cases in DW_OP_deref 2021-02-10 17:27:02 -08:00
Expression.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ExpressionVariable.cpp Unify the return value of GetByteSize to an llvm::Optional<uint64_t> (NFC-ish) 2020-07-27 13:26:35 -07:00
FunctionCaller.cpp Handle the case where a thread exits while we are running a function on it. 2020-05-21 17:55:53 -07:00
IRExecutionUnit.cpp Use !hasLocalLinkage instead of listing the symbol types 2020-10-29 14:44:06 -07:00
IRInterpreter.cpp [lldb] Remove redundant WithFormat suffixes (NFC) 2020-07-20 23:00:32 -07:00
IRMemoryMap.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LLVMUserExpression.cpp Handle the case where a thread exits while we are running a function on it. 2020-05-21 17:55:53 -07:00
Materializer.cpp [lldb/Utility] Add unit tests for RegisterValue::GetScalarValue 2020-11-03 16:12:32 +01:00
REPL.cpp Use zu rather than llu format specifier for size_t (-Wformat warning fix). 2020-09-16 19:28:05 -07:00
UserExpression.cpp [lldb] Fix that running a top level expression without a process fails with a cryptic error 2021-02-11 17:07:11 +01:00
UtilityFunction.cpp [lldb] Fix missing initialization in UtilityFunction ctor (NFC) 2020-10-22 21:12:27 -07:00