[PATCH 14/14] [WineDbg]: fix some casts issues on 64bit platform

Eric Pouech eric.pouech at orange.fr
Sat Dec 12 05:20:02 CST 2009




A+
---

 programs/winedbg/dbg.y        |    4 ++--
 programs/winedbg/debugger.h   |    2 +-
 programs/winedbg/stack.c      |    2 +-
 programs/winedbg/symbol.c     |    4 ++--
 programs/winedbg/tgt_active.c |    4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)


diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y
index 855407f..7ed6307 100644
--- a/programs/winedbg/dbg.y
+++ b/programs/winedbg/dbg.y
@@ -281,9 +281,9 @@ info_command:
     | tINFO tCLASS              { info_win32_class(NULL, NULL); }
     | tINFO tCLASS tSTRING     	{ info_win32_class(NULL, $3); }
     | tINFO tWND                { info_win32_window(NULL, FALSE); }
-    | tINFO tWND expr_rvalue    { info_win32_window((HWND)$3, FALSE); }
+    | tINFO tWND expr_rvalue    { info_win32_window((HWND)(DWORD_PTR)$3, FALSE); }
     | tINFO '*' tWND            { info_win32_window(NULL, TRUE); }
-    | tINFO '*' tWND expr_rvalue { info_win32_window((HWND)$4, TRUE); }
+    | tINFO '*' tWND expr_rvalue { info_win32_window((HWND)(DWORD_PTR)$4, TRUE); }
     | tINFO tPROCESS            { info_win32_processes(); }
     | tINFO tTHREAD             { info_win32_threads(); }
     | tINFO tEXCEPTION          { info_win32_exceptions(dbg_curr_tid); }
diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h
index 7e2559e..e48dbd3 100644
--- a/programs/winedbg/debugger.h
+++ b/programs/winedbg/debugger.h
@@ -397,7 +397,7 @@ extern void             symbol_read_symtable(const char* filename, unsigned long
 extern enum dbg_line_status symbol_get_function_line_status(const ADDRESS64* addr);
 extern BOOL             symbol_get_line(const char* filename, const char* func, IMAGEHLP_LINE64* ret);
 extern void             symbol_info(const char* str);
-extern void             symbol_print_local(const SYMBOL_INFO* sym, ULONG_PTR base, BOOL detailed);
+extern void             symbol_print_local(const SYMBOL_INFO* sym, DWORD_PTR base, BOOL detailed);
 extern int              symbol_info_locals(void);
 extern BOOL             symbol_is_local(const char* name);
 struct sgv_data;
diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c
index 221ad34..c80e5c3 100644
--- a/programs/winedbg/stack.c
+++ b/programs/winedbg/stack.c
@@ -124,7 +124,7 @@ BOOL stack_set_frame(int newframe)
     ADDRESS64   addr;
     if (!stack_set_frame_internal(newframe)) return FALSE;
     addr.Mode = AddrModeFlat;
-    addr.Offset = (unsigned long)memory_to_linear_addr(&dbg_curr_thread->frames[dbg_curr_thread->curr_frame].addr_pc);
+    addr.Offset = (DWORD_PTR)memory_to_linear_addr(&dbg_curr_thread->frames[dbg_curr_thread->curr_frame].addr_pc);
     source_list_from_addr(&addr, 0);
     return TRUE;
 }
diff --git a/programs/winedbg/symbol.c b/programs/winedbg/symbol.c
index 35d1c5d..ca2feee 100644
--- a/programs/winedbg/symbol.c
+++ b/programs/winedbg/symbol.c
@@ -648,7 +648,7 @@ BOOL symbol_get_line(const char* filename, const char* name,
  * <name>=<value> (local|pmt <where>)   in detailed form
  * Note <value> can be an error message in case of error
  */
-void symbol_print_local(const SYMBOL_INFO* sym, ULONG_PTR base, BOOL detailed)
+void symbol_print_local(const SYMBOL_INFO* sym, DWORD_PTR base, BOOL detailed)
 {
     struct dbg_lvalue   lvalue;
     char                buffer[64];
@@ -682,7 +682,7 @@ static BOOL CALLBACK info_locals_cb(PSYMBOL_INFO sym, ULONG size, PVOID ctx)
     types_print_type(&type, FALSE);
 
     dbg_printf(" ");
-    symbol_print_local(sym, (ULONG_PTR)ctx, TRUE);
+    symbol_print_local(sym, (DWORD_PTR)ctx, TRUE);
     dbg_printf("\n");
 
     return TRUE;
diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c
index 8d13667..232b2cc 100644
--- a/programs/winedbg/tgt_active.c
+++ b/programs/winedbg/tgt_active.c
@@ -616,8 +616,8 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
         break_set_xpoints(TRUE);
         if (DBG_IVAR(BreakOnDllLoad))
         {
-            dbg_printf("Stopping on DLL %s loading at 0x%08lx\n",
-                       dbg_W2A(u.buffer, -1), (unsigned long)de->u.LoadDll.lpBaseOfDll);
+            dbg_printf("Stopping on DLL %s loading at %p\n",
+                       dbg_W2A(u.buffer, -1), de->u.LoadDll.lpBaseOfDll);
             if (dbg_fetch_context()) cont = 0;
         }
         break;






More information about the wine-patches mailing list