[PATCH] A couple of fixes after running valgrind on winedbg

Eric Pouech eric.pouech at wanadoo.fr
Wed Feb 15 07:25:55 CST 2006



---

 programs/winedbg/stack.c   |    3 ++-
 programs/winedbg/winedbg.c |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c
index f506f5f..91796c8 100644
--- a/programs/winedbg/stack.c
+++ b/programs/winedbg/stack.c
@@ -84,6 +84,7 @@ static BOOL stack_set_frame_internal(int
 
 static BOOL stack_get_frame(int nf, IMAGEHLP_STACK_FRAME* ihsf)
 {
+    memset(ihsf, 0, sizeof(*ihsf));
     ihsf->InstructionOffset = (unsigned long)memory_to_linear_addr(&dbg_curr_thread->frames[nf].addr_pc);
     ihsf->FrameOffset = (unsigned long)memory_to_linear_addr(&dbg_curr_thread->frames[nf].addr_frame);
     return TRUE;
@@ -229,7 +230,7 @@ static void stack_print_addr_and_args(in
         DWORD           disp;
 
         dbg_printf(" %s", si->Name);
-        if (disp) dbg_printf("+0x%lx", (DWORD_PTR)disp64);
+        if (disp64) dbg_printf("+0x%lx", (DWORD_PTR)disp64);
 
         SymSetContext(dbg_curr_process->handle, &ihsf, NULL);
         se.tmp = tmp;
diff --git a/programs/winedbg/winedbg.c b/programs/winedbg/winedbg.c
index 3a1caef..fae7a42 100644
--- a/programs/winedbg/winedbg.c
+++ b/programs/winedbg/winedbg.c
@@ -397,6 +397,7 @@ struct dbg_thread* dbg_add_thread(struct
     t->frames = NULL;
     t->num_frames = 0;
     t->curr_frame = -1;
+    t->addr_mode = AddrModeFlat;
 
     snprintf(t->name, sizeof(t->name), "0x%08lx", tid);
 





More information about the wine-patches mailing list