[RFA/windows] cast of address to DWORD warning (handle_unload_dll)

Joel Brobecker brobecker@adacore.com
Wed Jan 14 03:42:00 GMT 2009


Hi Chris,

This is one last case of a conversion of an address to an integer
type whose size doesn't match on Windows64. I missed this one previously
because the sources used by AdaCore don't produce this error message[1].

Other than that, I verified that a clean checkout of the sources
allow us to build GDB on Vista64 with no warning. What's left to do
is to add the last necessary bits to allow this port to be built
as a target only, and then announce the port in the NEWS file...

2009-11-14  Joel Brobecker  <brobecker@adacore.com>

        * windows-nat.c (handle_unload_dll): Use host_address to string
        in order to print the base address of the DLL that was unloaded.

This one is hard to test, because it's supposed to never happen.
So I tested it by, ahem, visual inspection (I learnt that expression
at my first job, where we were producing safety critical software).

Thanks,
-- 
Joel
-------------- next part --------------
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 724c18f..43b3d3d 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -761,7 +761,8 @@ handle_unload_dll (void *dummy)
 	return 1;
       }
 
-  error (_("Error: dll starting at 0x%lx not found."), (DWORD) lpBaseOfDll);
+  error (_("Error: dll starting at %s not found."),
+	 host_address_to_string (lpBaseOfDll));
 
   return 0;
 }


More information about the Gdb-patches mailing list