Win64 patch 3/5 (winedbg)

Ge van Geldorp ge at gse.nl
Fri Jun 30 14:37:38 CDT 2006


Changelog:
  Ge van Geldorp <ge at gse.nl>
  - Adjust the parameters of the backend read/write routines to match those of
    ReadProcessMemory/WriteProcessMemory, since those are the ones actually
    used.

--- a/programs/winedbg/be_alpha.c
+++ b/programs/winedbg/be_alpha.c
@@ -87,7 +87,7 @@ static unsigned be_alpha_insert_Xpoint(H
                                        void* addr, unsigned long* val, unsigned size)
 {
     unsigned long       xbp;
-    unsigned long       sz;
+    SIZE_T              sz;
 
     switch (type)
     {
diff --git a/programs/winedbg/be_i386.c b/programs/winedbg/be_i386.c
index c7521fe..e82216e 100644
--- a/programs/winedbg/be_i386.c
+++ b/programs/winedbg/be_i386.c
@@ -467,7 +467,7 @@ static unsigned be_i386_insert_Xpoint(HA
                                       void* addr, unsigned long* val, unsigned size)
 {
     unsigned char       ch;
-    unsigned long       sz;
+    SIZE_T              sz;
     unsigned long*      pr;
     int                 reg;
     unsigned long       bits;
@@ -517,7 +517,7 @@ static unsigned be_i386_remove_Xpoint(HA
                                       CONTEXT* ctx, enum be_xpoint_type type, 
                                       void* addr, unsigned long val, unsigned size)
 {
-    unsigned long       sz;
+    SIZE_T              sz;
     unsigned char       ch;
 
     switch (type)
diff --git a/programs/winedbg/be_ppc.c b/programs/winedbg/be_ppc.c
index db3b5d5..fcd92a7 100644
--- a/programs/winedbg/be_ppc.c
+++ b/programs/winedbg/be_ppc.c
@@ -100,7 +100,7 @@ static unsigned be_ppc_insert_Xpoint(HAN
                                      void* addr, unsigned long* val, unsigned size)
 {
     unsigned long       xbp;
-    unsigned long       sz;
+    SIZE_T              sz;
 
     switch (type)
     {
@@ -121,7 +121,7 @@ static unsigned be_ppc_remove_Xpoint(HAN
                                      CONTEXT* ctx, enum be_xpoint_type type,
                                      void* addr, unsigned long val, unsigned size)
 {
-    unsigned long       sz;
+    SIZE_T              sz;
 
     switch (type)
     {
diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h
index c51ccc6..1452ff6 100644
--- a/programs/winedbg/debugger.h
+++ b/programs/winedbg/debugger.h
@@ -218,8 +218,8 @@ struct dbg_process
 struct be_process_io
 {
     BOOL        (*close_process)(struct dbg_process*, BOOL);
-    BOOL        (WINAPI *read)(HANDLE, const void*, void*, DWORD, DWORD*);
-    BOOL        (WINAPI *write)(HANDLE, void*, const void*, DWORD, DWORD*);
+    BOOL        (WINAPI *read)(HANDLE, const void*, void*, SIZE_T, SIZE_T*);
+    BOOL        (WINAPI *write)(HANDLE, void*, const void*, SIZE_T, SIZE_T*);
 };
 
 extern	struct dbg_process*	dbg_curr_process;
diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
index 45a4522..e6b61e9 100644
--- a/programs/winedbg/gdbproxy.c
+++ b/programs/winedbg/gdbproxy.c
@@ -1302,7 +1302,7 @@ static enum packet_return packet_read_me
     char               *addr;
     unsigned int        len, blk_len, nread;
     char                buffer[32];
-    unsigned long       r = 0;
+    SIZE_T              r = 0;
 
     assert(gdbctx->in_trap);
     /* FIXME:check in_packet_len for reading %p,%x */
@@ -1334,7 +1334,7 @@ static enum packet_return packet_write_m
     unsigned int        len, blk_len;
     char*               ptr;
     char                buffer[32];
-    unsigned long       w;
+    SIZE_T              w;
 
     assert(gdbctx->in_trap);
     ptr = memchr(gdbctx->in_packet, ':', gdbctx->in_packet_len);
diff --git a/programs/winedbg/memory.c b/programs/winedbg/memory.c
index fca6e3d..da964a4 100644
--- a/programs/winedbg/memory.c
+++ b/programs/winedbg/memory.c
@@ -231,7 +231,7 @@ #define DO_DUMP(_t,_l,_f) DO_DUMP2(_t,_l
 BOOL memory_get_string(struct dbg_process* pcs, void* addr, BOOL in_debuggee,
                        BOOL unicode, char* buffer, int size)
 {
-    DWORD       sz;
+    SIZE_T      sz;
     WCHAR*      buffW;
 
     buffer[0] = 0;
@@ -262,7 +262,7 @@ BOOL memory_get_string(struct dbg_proces
 BOOL memory_get_string_indirect(struct dbg_process* pcs, void* addr, BOOL unicode, char* buffer, int size)
 {
     void*       ad;
-    DWORD	sz;
+    SIZE_T	sz;
 
     buffer[0] = 0;
     if (addr && 
diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c
index b976117..c2dec5f 100644
--- a/programs/winedbg/stack.c
+++ b/programs/winedbg/stack.c
@@ -127,9 +127,14 @@ BOOL stack_get_current_symbol(SYMBOL_INF
 static BOOL CALLBACK stack_read_mem(HANDLE hProc, DWORD addr, 
                                     PVOID buffer, DWORD size, PDWORD written)
 {
+    SIZE_T sz;
+    BOOL ret;
+
     struct dbg_process* pcs = dbg_get_process_h(hProc);
     if (!pcs) return FALSE;
-    return pcs->process_io->read(hProc, (const void*)addr, buffer, size, written);
+    ret = pcs->process_io->read(hProc, (const void*)addr, buffer, size, &sz);
+    if (written != NULL) *written = sz;
+    return ret;
 }
 
 /******************************************************************
-- 
1.4.0




More information about the wine-patches mailing list