From d3653bf63512b822238f8b0ccc812353f26cab33 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Fri, 9 Jan 2009 10:58:26 +0000 Subject: [PATCH] * win32-nat.c (get_module_name): Change the type of parameter "base_address" to LPVOID. Remove unnecessary cast. (struct lm_info): Change type of load_addr to LPVOID. (win32_make_so): Change the type of parameter "load_addr" to LPVOID. Remove some unnecessary casts. (handle_unload_dll): Change the type of "lpBaseOfDll" to LPVOID. (win32_xfer_shared_libraries): Add missing cast. --- gdb/ChangeLog | 10 ++++++++++ gdb/win32-nat.c | 19 ++++++++++--------- gdb/windows-nat.c | 19 ++++++++++--------- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8015767..3abe002 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,15 @@ 2009-01-09 Joel Brobecker + * win32-nat.c (get_module_name): Change the type of parameter + "base_address" to LPVOID. Remove unnecessary cast. + (struct lm_info): Change type of load_addr to LPVOID. + (win32_make_so): Change the type of parameter "load_addr" + to LPVOID. Remove some unnecessary casts. + (handle_unload_dll): Change the type of "lpBaseOfDll" to LPVOID. + (win32_xfer_shared_libraries): Add missing cast. + +2009-01-09 Joel Brobecker + * win32-nat.c (has_detach_ability, set_process_privilege): Cast the result of GetProcAddress to (void *) to avoid a compilation warning. diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index 5300731..66ebdd6 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -481,7 +481,7 @@ static DWORD WINAPI (*psapi_GetModuleFileNameExA) (HANDLE, HMODULE, LPSTR, is zero return the first loaded module (which is always the name of the executable). */ static int -get_module_name (DWORD base_address, char *dll_name_ret) +get_module_name (LPVOID base_address, char *dll_name_ret) { DWORD len; MODULEINFO mi; @@ -524,7 +524,7 @@ get_module_name (DWORD base_address, char *dll_name_ret) &mi, sizeof (mi))) error (_("Can't get module info")); - if (!base_address || (DWORD) (mi.lpBaseOfDll) == base_address) + if (!base_address || mi.lpBaseOfDll == base_address) { /* Try to find the name of the given module */ len = psapi_GetModuleFileNameExA (current_process_handle, @@ -560,7 +560,7 @@ struct safe_symbol_file_add_args /* Maintain a linked list of "so" information. */ struct lm_info { - DWORD load_addr; + LPVOID load_addr; }; static struct so_list solib_start, *solib_end; @@ -619,7 +619,7 @@ safe_symbol_file_add (char *name, int from_tty, } static struct so_list * -win32_make_so (const char *name, DWORD load_addr) +win32_make_so (const char *name, LPVOID load_addr) { struct so_list *so; char buf[MAX_PATH + 1]; @@ -746,7 +746,7 @@ handle_load_dll (void *dummy) dll_buf[0] = dll_buf[sizeof (dll_buf) - 1] = '\0'; - if (!get_module_name ((DWORD) event->lpBaseOfDll, dll_buf)) + if (!get_module_name (event->lpBaseOfDll, dll_buf)) dll_buf[0] = dll_buf[sizeof (dll_buf) - 1] = '\0'; dll_name = dll_buf; @@ -757,11 +757,11 @@ handle_load_dll (void *dummy) if (!dll_name) return 1; - solib_end->next = win32_make_so (dll_name, (DWORD) event->lpBaseOfDll); + solib_end->next = win32_make_so (dll_name, event->lpBaseOfDll); solib_end = solib_end->next; DEBUG_EVENTS (("gdb: Loading dll \"%s\" at 0x%lx.\n", solib_end->so_name, - (DWORD) solib_end->lm_info->load_addr)); + solib_end->lm_info->load_addr)); return 1; } @@ -777,7 +777,7 @@ win32_free_so (struct so_list *so) static int handle_unload_dll (void *dummy) { - DWORD lpBaseOfDll = (DWORD) current_event.u.UnloadDll.lpBaseOfDll; + LPVOID lpBaseOfDll = current_event.u.UnloadDll.lpBaseOfDll; struct so_list *so; for (so = &solib_start; so->next != NULL; so = so->next) @@ -2082,7 +2082,8 @@ win32_xfer_shared_libraries (struct target_ops *ops, obstack_init (&obstack); obstack_grow_str (&obstack, "\n"); for (so = solib_start.next; so; so = so->next) - win32_xfer_shared_library (so->so_name, so->lm_info->load_addr, &obstack); + win32_xfer_shared_library (so->so_name, (CORE_ADDR) so->lm_info->load_addr, + &obstack); obstack_grow_str0 (&obstack, "\n"); buf = obstack_finish (&obstack); diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 5300731..66ebdd6 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -481,7 +481,7 @@ static DWORD WINAPI (*psapi_GetModuleFileNameExA) (HANDLE, HMODULE, LPSTR, is zero return the first loaded module (which is always the name of the executable). */ static int -get_module_name (DWORD base_address, char *dll_name_ret) +get_module_name (LPVOID base_address, char *dll_name_ret) { DWORD len; MODULEINFO mi; @@ -524,7 +524,7 @@ get_module_name (DWORD base_address, char *dll_name_ret) &mi, sizeof (mi))) error (_("Can't get module info")); - if (!base_address || (DWORD) (mi.lpBaseOfDll) == base_address) + if (!base_address || mi.lpBaseOfDll == base_address) { /* Try to find the name of the given module */ len = psapi_GetModuleFileNameExA (current_process_handle, @@ -560,7 +560,7 @@ struct safe_symbol_file_add_args /* Maintain a linked list of "so" information. */ struct lm_info { - DWORD load_addr; + LPVOID load_addr; }; static struct so_list solib_start, *solib_end; @@ -619,7 +619,7 @@ safe_symbol_file_add (char *name, int from_tty, } static struct so_list * -win32_make_so (const char *name, DWORD load_addr) +win32_make_so (const char *name, LPVOID load_addr) { struct so_list *so; char buf[MAX_PATH + 1]; @@ -746,7 +746,7 @@ handle_load_dll (void *dummy) dll_buf[0] = dll_buf[sizeof (dll_buf) - 1] = '\0'; - if (!get_module_name ((DWORD) event->lpBaseOfDll, dll_buf)) + if (!get_module_name (event->lpBaseOfDll, dll_buf)) dll_buf[0] = dll_buf[sizeof (dll_buf) - 1] = '\0'; dll_name = dll_buf; @@ -757,11 +757,11 @@ handle_load_dll (void *dummy) if (!dll_name) return 1; - solib_end->next = win32_make_so (dll_name, (DWORD) event->lpBaseOfDll); + solib_end->next = win32_make_so (dll_name, event->lpBaseOfDll); solib_end = solib_end->next; DEBUG_EVENTS (("gdb: Loading dll \"%s\" at 0x%lx.\n", solib_end->so_name, - (DWORD) solib_end->lm_info->load_addr)); + solib_end->lm_info->load_addr)); return 1; } @@ -777,7 +777,7 @@ win32_free_so (struct so_list *so) static int handle_unload_dll (void *dummy) { - DWORD lpBaseOfDll = (DWORD) current_event.u.UnloadDll.lpBaseOfDll; + LPVOID lpBaseOfDll = current_event.u.UnloadDll.lpBaseOfDll; struct so_list *so; for (so = &solib_start; so->next != NULL; so = so->next) @@ -2082,7 +2082,8 @@ win32_xfer_shared_libraries (struct target_ops *ops, obstack_init (&obstack); obstack_grow_str (&obstack, "\n"); for (so = solib_start.next; so; so = so->next) - win32_xfer_shared_library (so->so_name, so->lm_info->load_addr, &obstack); + win32_xfer_shared_library (so->so_name, (CORE_ADDR) so->lm_info->load_addr, + &obstack); obstack_grow_str0 (&obstack, "\n"); buf = obstack_finish (&obstack); -- 2.7.4