[PATCH 3/6] [WineDbg]: now describe pointer size in CPU backend structure

Eric Pouech eric.pouech at orange.fr
Mon Apr 12 14:18:18 CDT 2010




A+
---

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


diff --git a/programs/winedbg/be_alpha.c b/programs/winedbg/be_alpha.c
index 3c470e7..76cddb5 100644
--- a/programs/winedbg/be_alpha.c
+++ b/programs/winedbg/be_alpha.c
@@ -146,6 +146,7 @@ static int be_alpha_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
 struct backend_cpu be_alpha =
 {
     IMAGE_FILE_MACHINE_ALPHA,
+    8,
     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 a08f8f0..005494d 100644
--- a/programs/winedbg/be_cpu.h
+++ b/programs/winedbg/be_cpu.h
@@ -23,7 +23,8 @@ enum be_xpoint_type {be_xpoint_break, be_xpoint_watch_exec, be_xpoint_watch_read
                      be_xpoint_watch_write};
 struct backend_cpu
 {
-    DWORD               machine;
+    const DWORD         machine;
+    const DWORD         pointer_size;
     /* ------------------------------------------------------------------------------
      * address manipulation
      * ------------------------------------------------------------------------------ */
diff --git a/programs/winedbg/be_i386.c b/programs/winedbg/be_i386.c
index 74676dd..d6111bd 100644
--- a/programs/winedbg/be_i386.c
+++ b/programs/winedbg/be_i386.c
@@ -738,6 +738,7 @@ static int be_i386_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
 struct backend_cpu be_i386 =
 {
     IMAGE_FILE_MACHINE_I386,
+    4,
     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 22becf2..2377648 100644
--- a/programs/winedbg/be_ppc.c
+++ b/programs/winedbg/be_ppc.c
@@ -170,6 +170,7 @@ static int be_ppc_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
 struct backend_cpu be_ppc =
 {
     IMAGE_FILE_MACHINE_POWERPC,
+    4,
     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 514310b..6099a78 100644
--- a/programs/winedbg/be_x86_64.c
+++ b/programs/winedbg/be_x86_64.c
@@ -547,6 +547,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,
+    8,
     be_cpu_linearize,
     be_cpu_build_addr,
     be_x86_64_get_addr,
diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h
index 18d1073..385a412 100644
--- a/programs/winedbg/debugger.h
+++ b/programs/winedbg/debugger.h
@@ -38,7 +38,7 @@
 #include "objbase.h"
 #include "oaidl.h"
 
-#define ADDRSIZE        ((unsigned)sizeof(void*))
+#define ADDRSIZE        (be_cpu->pointer_size)
 #define ADDRWIDTH       (ADDRSIZE * 2)
 
 /* the debugger uses these exceptions for it's internal use */






More information about the wine-patches mailing list