Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA/win32] Change the DLL base address type to LPVOID
Date: Fri, 09 Jan 2009 10:55:00 -0000	[thread overview]
Message-ID: <20090109105528.GH24105@adacore.com> (raw)
In-Reply-To: <20090107170405.GH31906@ednor.casa.cgf.cx>

[-- Attachment #1: Type: text/plain, Size: 717 bytes --]

> >2009-01-07  Joel Brobecker  <brobecker@adacore.com>
> >
> >        * 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.
> >
> >Tested on x86-windows.
> >OK to apply?
> 
> Yes.

Thank you. Checked in. And since I posted the wrong patch, I'm attaching
the patch I just checked in (Thanks to Jan for noticing).

-- 
Joel

[-- Attachment #2: lpvoid.diff --]
[-- Type: text/plain, Size: 2913 bytes --]

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, "<library-list>\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, "</library-list>\n");
 
   buf = obstack_finish (&obstack);

      reply	other threads:[~2009-01-09 10:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 11:46 Joel Brobecker
2009-01-07 14:43 ` Jan Kratochvil
2009-01-07 17:04 ` Christopher Faylor
2009-01-09 10:55   ` Joel Brobecker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090109105528.GH24105@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox