dbghelp: When unwinding i386 stacks, update CONTEXT with sp/bp/ip.

This commit is contained in:
Eric Pouech 2010-06-27 18:55:21 +02:00 committed by Alexandre Julliard
parent 1c037bf564
commit b6c8b8959b
1 changed files with 16 additions and 1 deletions

View File

@ -410,8 +410,23 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO
sw_read_mem(csw, frame->AddrFrame.Offset + 2 * sizeof(DWORD),
frame->Params, sizeof(frame->Params));
}
goto done_pep; /* just to ensure done_pep label is referenced */
#ifdef __i386__
if (context)
{
#define SET(field, seg, reg) \
switch (frame->field.Mode) \
{ \
case AddrModeFlat: context->reg = frame->field.Offset; break; \
case AddrMode1616: context->seg = frame->field.Segment; context->reg = frame->field.Offset; break; \
default: assert(0); \
}
SET(AddrStack, SegSs, Esp);
SET(AddrFrame, SegSs, Ebp);
SET(AddrReturn, SegCs, Eip);
#undef SET
}
done_pep:
#endif
frame->Far = TRUE;
frame->Virtual = TRUE;