This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] Use adequate storage for dr array in windows-nat.c
- From: Christopher Faylor <cgf-use-the-mailinglist-please at sourceware dot org>
- To: gdb-patches at sourceware dot org
- Date: Sun, 8 Mar 2009 17:11:08 -0400
- Subject: [patch] Use adequate storage for dr array in windows-nat.c
When I was getting ready to package up my last windows-nat.c checkin, I
noticed that I had some extra changes sitting in windows-nat.c. So,
rather than revert them, I checked them in. These were meant to address
reported problems with handling 64 bit addresses in the dr array. I
don't currently have any way to check if this causes a problem or not
(although I will correct that soon) so if I messed something up please
let me know.
cgf
2009-03-08 Christopher Faylor <me+cygwin@cgf.cx>
* windows-nat.c (dr): Redefine to use largest possible integer which
holds a pointer.
(cygwin_set_dr): Avoid coercion.
Index: windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -p -r1.182 -r1.183
--- windows-nat.c 24 Feb 2009 15:27:58 -0000 1.182
+++ windows-nat.c 8 Mar 2009 21:01:52 -0000 1.183
@@ -95,7 +95,7 @@ enum
#define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_DEBUG_REGISTERS \
| CONTEXT_EXTENDED_REGISTERS
-static unsigned dr[8];
+static uintptr_t dr[8];
static int debug_registers_changed;
static int debug_registers_used;
#define DR6_CLEAR_VALUE 0xffff0ff0
@@ -2245,7 +2274,7 @@ cygwin_set_dr (int i, CORE_ADDR addr)
if (i < 0 || i > 3)
internal_error (__FILE__, __LINE__,
_("Invalid register %d in cygwin_set_dr.\n"), i);
- dr[i] = (unsigned) addr;
+ dr[i] = addr;
debug_registers_changed = 1;
debug_registers_used = 1;
}