[PATCH 1/8] [WineDbg]: push the correct machine type to StackWalk

Eric Pouech eric.pouech at orange.fr
Tue Dec 22 07:20:16 CST 2009




A+
---

 programs/winedbg/be_alpha.c  |    1 +
 programs/winedbg/be_cpu.h    |    1 +
 programs/winedbg/be_i386.c   |    1 +
 programs/winedbg/be_ppc.c    |    1 +
 programs/winedbg/be_x86_64.c |    1 +
 programs/winedbg/stack.c     |    2 +-
 6 files changed, 6 insertions(+), 1 deletions(-)


diff --git a/programs/winedbg/be_alpha.c b/programs/winedbg/be_alpha.c
index 8ced1d6..57bdfd1 100644
--- a/programs/winedbg/be_alpha.c
+++ b/programs/winedbg/be_alpha.c
@@ -151,6 +151,7 @@ static int be_alpha_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
 
 struct backend_cpu be_alpha =
 {
+    IMAGE_FILE_MACHINE_ALPHA,
     be_cpu_linearize,
     be_cpu_build_addr,
     be_alpha_get_addr,
diff --git a/programs/winedbg/be_cpu.h b/programs/winedbg/be_cpu.h
index 8ce79d1..6679977 100644
--- a/programs/winedbg/be_cpu.h
+++ b/programs/winedbg/be_cpu.h
@@ -23,6 +23,7 @@ enum be_xpoint_type {be_xpoint_break, be_xpoint_watch_exec, be_xpoint_watch_read
                      be_xpoint_watch_write};
 struct backend_cpu
 {
+    DWORD               machine;
     /* ------------------------------------------------------------------------------
      * address manipulation
      * ------------------------------------------------------------------------------ */
diff --git a/programs/winedbg/be_i386.c b/programs/winedbg/be_i386.c
index e3e7a81..e805a80 100644
--- a/programs/winedbg/be_i386.c
+++ b/programs/winedbg/be_i386.c
@@ -746,6 +746,7 @@ static int be_i386_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
 
 struct backend_cpu be_i386 =
 {
+    IMAGE_FILE_MACHINE_I386,
     be_i386_linearize,
     be_i386_build_addr,
     be_i386_get_addr,
diff --git a/programs/winedbg/be_ppc.c b/programs/winedbg/be_ppc.c
index bff1571..9ba9994 100644
--- a/programs/winedbg/be_ppc.c
+++ b/programs/winedbg/be_ppc.c
@@ -175,6 +175,7 @@ static int be_ppc_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
 
 struct backend_cpu be_ppc =
 {
+    IMAGE_FILE_MACHINE_POWERPC,
     be_cpu_linearize,
     be_cpu_build_addr,
     be_ppc_get_addr,
diff --git a/programs/winedbg/be_x86_64.c b/programs/winedbg/be_x86_64.c
index 2f58c88..1ef52b8 100644
--- a/programs/winedbg/be_x86_64.c
+++ b/programs/winedbg/be_x86_64.c
@@ -376,6 +376,7 @@ static int be_x86_64_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
 
 struct backend_cpu be_x86_64 =
 {
+    IMAGE_FILE_MACHINE_AMD64,
     be_cpu_linearize,
     be_cpu_build_addr,
     be_x86_64_get_addr,
diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c
index c80e5c3..f448e8b 100644
--- a/programs/winedbg/stack.c
+++ b/programs/winedbg/stack.c
@@ -186,7 +186,7 @@ unsigned stack_fetch_frames(void)
         sf.AddrFrame.Mode = AddrModeFlat;
     }
 
-    while (StackWalk64(IMAGE_FILE_MACHINE_I386, dbg_curr_process->handle, 
+    while (StackWalk64(be_cpu->machine, dbg_curr_process->handle,
                        dbg_curr_thread->handle, &sf, &ctx, stack_read_mem,
                        SymFunctionTableAccess64, SymGetModuleBase64, NULL))
     {






More information about the wine-patches mailing list