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:
Rene Gollent 2013-07-21 19:03:37 -04:00
parent 49093da705
commit 6dbd3ed18c
1 changed files with 2 additions and 1 deletions

View File

@ -650,7 +650,8 @@ ArchitectureX86::GetReturnAddressLocation(StackFrame* frame,
return B_NO_MEMORY;
} else {
ValuePieceLocation piece;
piece.SetToMemory(frame->GetCpuState()->StackPointer());
CpuStateX86* state = dynamic_cast<CpuStateX86*>(frame->GetCpuState());
piece.SetToMemory(state->IntRegisterValue(X86_REGISTER_EAX));
piece.SetSize(valueSize);
if (!location->AddPiece(piece))
return B_NO_MEMORY;