[DebugInfo] DW_OP_deref_size in PrologEpilogInserter.
The PrologEpilogInserter need to insert a DW_OP_deref_size before prepending a memory location expression to an already implicit expression to avoid having the existing expression act on the memory address instead of the value behind it. The reason for using DW_OP_deref_size and not plain DW_OP_deref is that big-endian targets need to read the right size as simply truncating a larger read would yield the wrong result (LSB bytes are not at the lower address). This re-commit fixes issues reported in the first one. Namely deref was inserted under wrong conditions and additionally the deref_size argument was incorrectly encoded. Differential Revision: https://reviews.llvm.org/D59687 llvm-svn: 359535
This commit is contained in:
@@ -434,6 +434,10 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
|
||||
assert(LocationKind != Register);
|
||||
emitOp(dwarf::DW_OP_xderef);
|
||||
break;
|
||||
case dwarf::DW_OP_deref_size:
|
||||
emitOp(dwarf::DW_OP_deref_size);
|
||||
emitData1(Op->getArg(0));
|
||||
break;
|
||||
default:
|
||||
llvm_unreachable("unhandled opcode found in expression");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user