diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp --- a/lldb/source/Expression/DWARFExpression.cpp +++ b/lldb/source/Expression/DWARFExpression.cpp @@ -846,6 +846,26 @@ return true; } +static bool Evaluate_DW_OP_implicit_value(std::vector &stack, + ExecutionContext *exe_ctx, + RegisterContext *reg_ctx, + const DataExtractor &opcodes, + lldb::offset_t &opcode_offset, + Status *error_ptr, Log *log) { + + const uint32_t len = opcodes.GetULEB128(&opcode_offset); + const void *data = opcodes.GetData(&opcode_offset, len); + + if (!data) { + LLDB_LOG(log, "Evaluate_DW_OP_implicit_value: could not be read data"); + return false; + } + + Value result(data, len); + stack.push_back(result); + return true; +} + bool DWARFExpression::Evaluate(ExecutionContextScope *exe_scope, lldb::addr_t loclist_base_load_addr, const Value *initial_value_ptr, @@ -2248,6 +2268,23 @@ } break; + // OPCODE: DW_OP_implicit_value + // OPERANDS: 2 + // ULEB128 size of the value block in bytes + // uint8_t* block bytes encoding value in target's memory + // representation + // DESCRIPTION: Value is immediately stored in block in the debug info with + // the memory representation of the target. + case DW_OP_implicit_value: { + if (!Evaluate_DW_OP_implicit_value(stack, exe_ctx, reg_ctx, opcodes, + offset, error_ptr, log)) { + LLDB_ERRORF(error_ptr, "Could not evaluate %s.", + DW_OP_value_to_name(op)); + return false; + } + break; + } + // OPCODE: DW_OP_push_object_address // OPERANDS: none // DESCRIPTION: Pushes the address of the object currently being diff --git a/lldb/test/Shell/SymbolFile/DWARF/Inputs/implicit_value.c b/lldb/test/Shell/SymbolFile/DWARF/Inputs/implicit_value.c new file mode 100644 --- /dev/null +++ b/lldb/test/Shell/SymbolFile/DWARF/Inputs/implicit_value.c @@ -0,0 +1,6 @@ +int main() { + double d = 3.14; + printf("break here"); + d *= d; + return 0; +}