Debugger: Fix X86 handling of larger return values.
For return values too large to fit into EAX:EDX, the address at which the value is located is stored in EAX. We were incorrectly assuming they were at the current stack pointer, which isn't necessarily the case depending on what optimization/code generation options were used, leading to us sometimes showing the wrong values for such case. The same issue showed up with debug binaries generated by Clang.
This commit is contained in:
parent
49093da705
commit
6dbd3ed18c
|
@ -650,7 +650,8 @@ ArchitectureX86::GetReturnAddressLocation(StackFrame* frame,
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
} else {
|
} else {
|
||||||
ValuePieceLocation piece;
|
ValuePieceLocation piece;
|
||||||
piece.SetToMemory(frame->GetCpuState()->StackPointer());
|
CpuStateX86* state = dynamic_cast<CpuStateX86*>(frame->GetCpuState());
|
||||||
|
piece.SetToMemory(state->IntRegisterValue(X86_REGISTER_EAX));
|
||||||
piece.SetSize(valueSize);
|
piece.SetSize(valueSize);
|
||||||
if (!location->AddPiece(piece))
|
if (!location->AddPiece(piece))
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
Loading…
Reference in New Issue