winedbg: Cleanup the process_io usage.

- made be_process_io references 'const'
- make use of it for dbg_read_memory and dbg_write_memory
This commit is contained in:
Eric Pouech 2006-02-24 22:13:34 +01:00 committed by Alexandre Julliard
parent 829e002c3f
commit f16f847cc7
5 changed files with 13 additions and 13 deletions

View file

@ -82,7 +82,7 @@ static void be_alpha_disasm_one_insn(ADDRESS* addr, int display)
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(HANDLE hProcess, struct be_process_io* pi
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;

View file

@ -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 */

View file

@ -392,7 +392,7 @@ static inline int be_i386_get_unused_DR(CONTEXT* ctx, unsigned long** r)
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(HANDLE hProcess, struct be_process_io* pio
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)
{

View file

@ -95,7 +95,7 @@ static void be_ppc_disasm_one_insn(ADDRESS* addr, int display)
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(HANDLE hProcess, struct be_process_io* pio,
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)
{

View file

@ -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(unsigned int);
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)