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

Alexandre Julliard julliard at winehq.org
Mon Jun 28 11:01:19 CDT 2010


Module: wine
Branch: master
Commit: b6c8b8959be4d69db5448281cbddd64b43db228b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b6c8b8959be4d69db5448281cbddd64b43db228b

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Sun Jun 27 18:55:21 2010 +0200

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

---

 dlls/dbghelp/cpu_i386.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/dlls/dbghelp/cpu_i386.c b/dlls/dbghelp/cpu_i386.c
index dc00410..a88b00f 100644
--- a/dlls/dbghelp/cpu_i386.c
+++ b/dlls/dbghelp/cpu_i386.c
@@ -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;




More information about the wine-cvs mailing list