Module: wine Branch: refs/heads/master Commit: f16f847cc7254f5c229963cdaea1f7ec4782e749 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=f16f847cc7254f5c229963cd...
Author: Eric Pouech eric.pouech@wanadoo.fr Date: Fri Feb 24 22:13:34 2006 +0100
winedbg: Cleanup the process_io usage.
- made be_process_io references 'const' - make use of it for dbg_read_memory and dbg_write_memory
---
programs/winedbg/be_alpha.c | 8 ++++---- programs/winedbg/be_cpu.h | 4 ++-- programs/winedbg/be_i386.c | 4 ++-- programs/winedbg/be_ppc.c | 4 ++-- programs/winedbg/debugger.h | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/programs/winedbg/be_alpha.c b/programs/winedbg/be_alpha.c index 98bbe9a..221fd46 100644 --- a/programs/winedbg/be_alpha.c +++ b/programs/winedbg/be_alpha.c @@ -82,7 +82,7 @@ static void be_alpha_disasm_one_insn(ADD dbg_printf("Disasm NIY\n"); }
-static unsigned be_alpha_insert_Xpoint(HANDLE hProcess, struct be_process_io* pio, +static unsigned be_alpha_insert_Xpoint(HANDLE hProcess, const struct be_process_io* pio, CONTEXT* ctx, enum be_xpoint_type type, void* addr, unsigned long* val, unsigned size) { @@ -104,9 +104,9 @@ static unsigned be_alpha_insert_Xpoint(H return 1; }
-static unsigned be_alpha_remove_Xpoint(HANDLE hProcess, CONTEXT* ctx, - enum be_xpoint_type type, void* addr, - unsigned long val, unsigned size) +static unsigned be_alpha_remove_Xpoint(HANDLE hProcess, const struct be_process_io* pio, + CONTEXT* ctx, enum be_xpoint_type type, + void* addr, unsigned long val, unsigned size) { dbg_printf("not done\n"); return FALSE; diff --git a/programs/winedbg/be_cpu.h b/programs/winedbg/be_cpu.h index d776cf1..988a147 100644 --- a/programs/winedbg/be_cpu.h +++ b/programs/winedbg/be_cpu.h @@ -82,11 +82,11 @@ struct backend_cpu * break points / watchpoints handling * -------------------------------------------------------------------------------*/ /* Inserts an Xpoint in the CPU context and/or debuggee address space */ - unsigned (*insert_Xpoint)(HANDLE hProcess, struct be_process_io* pio, + unsigned (*insert_Xpoint)(HANDLE hProcess, const struct be_process_io* pio, CONTEXT* ctx, enum be_xpoint_type type, void* addr, unsigned long* val, unsigned size); /* Removes an Xpoint in the CPU context and/or debuggee address space */ - unsigned (*remove_Xpoint)(HANDLE hProcess, struct be_process_io* pio, + unsigned (*remove_Xpoint)(HANDLE hProcess, const struct be_process_io* pio, CONTEXT* ctx, enum be_xpoint_type type, void* addr, unsigned long val, unsigned size); /* Checks whether a given watchpoint has been triggered */ diff --git a/programs/winedbg/be_i386.c b/programs/winedbg/be_i386.c index f1ee7be..1dc001d 100644 --- a/programs/winedbg/be_i386.c +++ b/programs/winedbg/be_i386.c @@ -392,7 +392,7 @@ static inline int be_i386_get_unused_DR( return -1; }
-static unsigned be_i386_insert_Xpoint(HANDLE hProcess, struct be_process_io* pio, +static unsigned be_i386_insert_Xpoint(HANDLE hProcess, const struct be_process_io* pio, CONTEXT* ctx, enum be_xpoint_type type, void* addr, unsigned long* val, unsigned size) { @@ -443,7 +443,7 @@ static unsigned be_i386_insert_Xpoint(HA return 1; }
-static unsigned be_i386_remove_Xpoint(HANDLE hProcess, struct be_process_io* pio, +static unsigned be_i386_remove_Xpoint(HANDLE hProcess, const struct be_process_io* pio, CONTEXT* ctx, enum be_xpoint_type type, void* addr, unsigned long val, unsigned size) { diff --git a/programs/winedbg/be_ppc.c b/programs/winedbg/be_ppc.c index e943dfa..2ea7164 100644 --- a/programs/winedbg/be_ppc.c +++ b/programs/winedbg/be_ppc.c @@ -95,7 +95,7 @@ static void be_ppc_disasm_one_insn(ADDRE dbg_printf("Disasm NIY\n"); }
-static unsigned be_ppc_insert_Xpoint(HANDLE hProcess, struct be_process_io* pio, +static unsigned be_ppc_insert_Xpoint(HANDLE hProcess, const struct be_process_io* pio, CONTEXT* ctx, enum be_xpoint_type type, void* addr, unsigned long* val, unsigned size) { @@ -117,7 +117,7 @@ static unsigned be_ppc_insert_Xpoint(HAN return 1; }
-static unsigned be_ppc_remove_Xpoint(HANDLE hProcess, struct be_process_io* pio, +static unsigned be_ppc_remove_Xpoint(HANDLE hProcess, const struct be_process_io* pio, CONTEXT* ctx, enum be_xpoint_type type, void* addr, unsigned long val, unsigned size) { diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h index 3c4acbf..97ad754 100644 --- a/programs/winedbg/debugger.h +++ b/programs/winedbg/debugger.h @@ -201,7 +201,7 @@ struct dbg_process { HANDLE handle; DWORD pid; - struct be_process_io* process_io; + const struct be_process_io* process_io; const char* imageName; struct dbg_thread* threads; unsigned continue_on_first_exception; @@ -417,13 +417,13 @@ extern BOOL gdb_remote(unsig static inline BOOL dbg_read_memory(const void* addr, void* buffer, size_t len) { DWORD rlen; - return ReadProcessMemory(dbg_curr_process->handle, addr, buffer, len, &rlen) && len == rlen; + return dbg_curr_process->process_io->read(dbg_curr_process->handle, addr, buffer, len, &rlen) && len == rlen; }
static inline BOOL dbg_write_memory(void* addr, const void* buffer, size_t len) { DWORD wlen; - return WriteProcessMemory(dbg_curr_process->handle, addr, buffer, len, &wlen) && len == wlen; + return dbg_curr_process->process_io->write(dbg_curr_process->handle, addr, buffer, len, &wlen) && len == wlen; }
static inline void* dbg_heap_realloc(void* buffer, size_t size)