* More debug output.

* Fixed _PushRegister(). It was ignoring the offset.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31631 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-07-18 23:13:06 +00:00
parent d26889cca5
commit 81ad27df05
@@ -250,7 +250,15 @@ printf("DwarfExpressionEvaluator::EvaluateLocation(): %s\n", exception.message);
status_t status_t
DwarfExpressionEvaluator::_Evaluate(ValuePieceLocation* _piece) DwarfExpressionEvaluator::_Evaluate(ValuePieceLocation* _piece)
{ {
printf("DwarfExpressionEvaluator::_Evaluate()\n"); {
printf("DwarfExpressionEvaluator::_Evaluate(%p, %lld)\n", fDataReader.Data(),
fDataReader.BytesRemaining());
const uint8* data = (const uint8*)fDataReader.Data();
int32 count = fDataReader.BytesRemaining();
for (int32 i = 0; i < count; i++)
printf(" %02x", data[i]);
printf("\n");
}
uint32 operationsExecuted = 0; uint32 operationsExecuted = 0;
while (fDataReader.BytesRemaining() > 0) { while (fDataReader.BytesRemaining() > 0) {
@@ -531,13 +539,14 @@ printf(" DW_OP_call_frame_cfa\n");
} }
case DW_OP_fbreg: case DW_OP_fbreg:
{ {
printf(" DW_OP_fbreg\n"); int64 offset = fDataReader.ReadSignedLEB128(0);
printf(" DW_OP_fbreg(%lld)\n", offset);
target_addr_t address; target_addr_t address;
if (!fContext->GetFrameBaseAddress(address)) { if (!fContext->GetFrameBaseAddress(address)) {
throw EvaluationException( throw EvaluationException(
"failed to get frame base address"); "failed to get frame base address");
} }
_Push(address + fDataReader.ReadSignedLEB128(0)); _Push(address + offset);
break; break;
} }
case DW_OP_form_tls_address: case DW_OP_form_tls_address:
@@ -615,9 +624,9 @@ printf(" DW_OP_reg%u\n", opcode - DW_OP_reg0);
_piece->SetToRegister(opcode - DW_OP_reg0); _piece->SetToRegister(opcode - DW_OP_reg0);
return B_OK; return B_OK;
} else if (opcode >= DW_OP_breg0 && opcode <= DW_OP_breg31) { } else if (opcode >= DW_OP_breg0 && opcode <= DW_OP_breg31) {
printf(" DW_OP_breg%u\n", opcode - DW_OP_breg0); int64 offset = fDataReader.ReadSignedLEB128(0);
_PushRegister(opcode - DW_OP_breg0, printf(" DW_OP_breg%u(%lld)\n", opcode - DW_OP_breg0, offset);
fDataReader.ReadSignedLEB128(0)); _PushRegister(opcode - DW_OP_breg0, offset);
} else { } else {
printf("DwarfExpressionEvaluator::_Evaluate(): unsupported " printf("DwarfExpressionEvaluator::_Evaluate(): unsupported "
"opcode: %u\n", opcode); "opcode: %u\n", opcode);
@@ -712,7 +721,7 @@ DwarfExpressionEvaluator::_PushRegister(uint32 reg, target_addr_t offset)
if (!fContext->TargetInterface()->GetRegisterValue(reg, value)) if (!fContext->TargetInterface()->GetRegisterValue(reg, value))
throw EvaluationException("failed to get register"); throw EvaluationException("failed to get register");
_Push(value.ToUInt64()); _Push(value.ToUInt64() + offset);
} }