Work-around for a gcc 2.95.3 peculiarity: The DW_OP_reg* are incorrectly used

in non-location expressions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33916 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-11-06 14:59:22 +00:00
parent c9b58a7313
commit 0b7f2d9924
1 changed files with 6 additions and 4 deletions

View File

@ -633,11 +633,13 @@ DwarfExpressionEvaluator::_Evaluate(ValuePieceLocation* _piece)
} else if (opcode >= DW_OP_reg0 && opcode <= DW_OP_reg31) {
TRACE_EXPR(" DW_OP_reg%u\n", opcode - DW_OP_reg0);
if (_piece == NULL) {
throw EvaluationException(
"DW_OP_reg* in non-location expression");
// NOTE: Using these opcodes is actually only allowed in
// location expression, but gcc 2.95.3 does otherwise.
_PushRegister(opcode - DW_OP_reg0, 0);
} else {
_piece->SetToRegister(opcode - DW_OP_reg0);
return B_OK;
}
_piece->SetToRegister(opcode - DW_OP_reg0);
return B_OK;
} else if (opcode >= DW_OP_breg0 && opcode <= DW_OP_breg31) {
int64 offset = fDataReader.ReadSignedLEB128(0);
TRACE_EXPR(" DW_OP_breg%u(%lld)\n", opcode - DW_OP_breg0,