Index: win32-nat.c =================================================================== RCS file: /cvs/src/src/gdb/win32-nat.c,v retrieving revision 1.40 diff -r1.40 win32-nat.c 71c71,72 < #define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_EXTENDED_REGISTERS --- > #define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_DEBUG_REGISTERS \ > | CONTEXT_EXTENDED_REGISTERS 73c74 < #define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER --- > #define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_DEBUG_REGISTERS 75a77,79 > static unsigned dr[8]; > static int debug_registers_changed = 0; > 235a240,249 > if (id == current_event.dwThreadId) > { > /* Copy dr values from that thread. */ > dr[0] = th->context.Dr0; > dr[1] = th->context.Dr1; > dr[2] = th->context.Dr2; > dr[3] = th->context.Dr3; > dr[6] = th->context.Dr6; > dr[7] = th->context.Dr7; > } 877a892,904 > if (debug_registers_changed) > { > /* Only change the value of the debug registers. */ > th->context.ContextFlags = CONTEXT_DEBUG_REGISTERS; > th->context.Dr0 = dr[0]; > th->context.Dr1 = dr[1]; > th->context.Dr2 = dr[2]; > th->context.Dr3 = dr[3]; > th->context.Dr6 = dr[6]; > th->context.Dr7 = dr[7]; > CHECK (SetThreadContext (th->h, &th->context)); > th->context.ContextFlags = 0; > } 882a910 > debug_registers_changed = 0; 1061a1090 > int i; 1065a1095,1097 > debug_registers_changed = 0; > for (i = 0; i <= 7; i++) > dr[i] = 0; 1344a1377 > i386_cleanup_dregs(); 1411a1445 > 1431a1466,1474 > if (debug_registers_changed) > { > th->context.Dr0 = dr[0]; > th->context.Dr1 = dr[1]; > th->context.Dr2 = dr[2]; > th->context.Dr3 = dr[3]; > th->context.Dr6 = dr[6]; > th->context.Dr7 = dr[7]; > } 1563a1607,1641 > > /* Hardware watchpoint support, adapted from go32-nat.c code. */ > > /* Pass the address ADDR to the inferior in the I'th debug register. > Here we just store the address in dr array, the registers will be > actually set up when child_continue is called. */ > void > 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; > debug_registers_changed = 1; > } > > /* Pass the value VAL to the inferior in the DR7 debug control > register. Here we just store the address in D_REGS, the watchpoint > will be actually set up in child_wait. */ > void > cygwin_set_dr7 (unsigned val) > { > dr[7] = val; > debug_registers_changed = 1; > } > > /* Get the value of the DR6 debug status register from the inferior. > Here we just return the value stored in D_REGS, as we've got it > from the last go32_wait call. */ > unsigned > cygwin_get_dr6 (void) > { > return dr[6]; > } > Index: config/i386/cygwin.mh =================================================================== RCS file: /cvs/src/src/gdb/config/i386/cygwin.mh,v retrieving revision 1.4 diff -r1.4 cygwin.mh 4,5c4,5 < NATDEPFILES= win32-nat.o corelow.o < NAT_FILE=../none/nm-none.h --- > NATDEPFILES= i386-nat.o win32-nat.o corelow.o > NAT_FILE=nm-cygwin.h /* Native definitions for Intel x86 running CYGWIN. Copyright (C) 2001 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define NO_PTRACE_H #define I386_USE_GENERIC_WATCHPOINTS #include "i386/nm-i386.h" /* Support for hardware-assisted breakpoints and watchpoints. */ #define I386_DR_LOW_SET_CONTROL(VAL) cygwin_set_dr7 (VAL) extern void cygwin_set_dr7 (unsigned); #define I386_DR_LOW_SET_ADDR(N,ADDR) cygwin_set_dr (N,ADDR) extern void cygwin_set_dr (int, CORE_ADDR); #define I386_DR_LOW_RESET_ADDR(N) #define I386_DR_LOW_GET_STATUS() cygwin_get_dr6 () extern unsigned cygwin_get_dr6 (void);