This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gdb] Data watchpoints in Windows weirdness. Call for testers.


Pedro Alves wrote:

> Corinna Vinschen wrote:
> 
>> I could reproduce it on Win2K SP4, Vista, and under WOW64 on Vista 64.
> 
> Thank you.

Gdb 6.6 (installed with Insight 6.6) doesn't seem to have the problem:

GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) watch count
Hardware watchpoint 1: count
(gdb) start
Breakpoint 2 at 0x401075: file test.c, line 8.
Starting program: /home/rberber/test.exe
Hardware watchpoint 1: countHardware watchpoint 1: countHardware watchpoint 1:
countHardware watchpoint 1: countHardware watchpoint 1: countLoaded symbols for
/c/WINDOWS/system32/ntdll.dll
Loaded symbols for /c/WINDOWS/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /c/WINDOWS/system32/advapi32.dll
Loaded symbols for /c/WINDOWS/system32/rpcrt4.dll
Hardware watchpoint 1: countHardware watchpoint 1: countHardware watchpoint 1:
countHardware watchpoint 1: countHardware watchpoint 1: countmain () at test.c:8
8	{
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
main () at test.c:11
11	  printf ("count %d\n", count);
(gdb)
Continuing.
Hardware watchpoint 1: count

Old value = 0
New value = 1000
main () at test.c:16
16	      printf ("count %d\n", count);
(gdb)
Continuing.
Hardware watchpoint 1: count

Old value = 1000
New value = 1001
main () at test.c:18
18	      Sleep (1000);
(gdb)
Continuing.
Hardware watchpoint 1: count

Old value = 1001
New value = 1002
main () at test.c:18
18	      Sleep (1000);
(gdb)
Continuing.
Hardware watchpoint 1: count

Old value = 1002
New value = 1003
main () at test.c:18
18	      Sleep (1000);
(gdb)
Continuing.
Hardware watchpoint 1: count

Old value = 1003
New value = 1004
main () at test.c:18
18	      Sleep (1000);
(gdb)
Continuing.
Hardware watchpoint 1: count

Old value = 1004
New value = 1005
main () at test.c:18
18	      Sleep (1000);
...

One more time:

GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) watch count
Hardware watchpoint 1: count
(gdb) set debug infrun 1
(gdb) set debugevents 1
(gdb) set debugexceptions 1
(gdb) maint show-debug-regs 1
(gdb) start
Breakpoint 2 at 0x401075: file test.c, line 8.
Starting program: /home/rberber/test.exe
gdb: win32_init_thread_list
infrun: wait_for_inferior
gdb: kernel event for pid=1444 tid=2104 code=CREATE_PROCESS_DEBUG_EVENT)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0)
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: prepare_to_wait
gdb: kernel event for pid=1444 tid=2104 code=LOAD_DLL_DEBUG_EVENT)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_LOADED
infrun: resume (step=0, signal=0)
Hardware watchpoint 1: countContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: prepare_to_wait
gdb: kernel event for pid=1444 tid=2104 code=LOAD_DLL_DEBUG_EVENT)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_LOADED
infrun: resume (step=0, signal=0)
Hardware watchpoint 1: countContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: prepare_to_wait
gdb: kernel event for pid=1444 tid=2104 code=LOAD_DLL_DEBUG_EVENT)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_LOADED
infrun: resume (step=0, signal=0)
Hardware watchpoint 1: countContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: prepare_to_wait
gdb: kernel event for pid=1444 tid=2104 code=LOAD_DLL_DEBUG_EVENT)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_LOADED
infrun: resume (step=0, signal=0)
Hardware watchpoint 1: countContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: prepare_to_wait
gdb: kernel event for pid=1444 tid=2104 code=LOAD_DLL_DEBUG_EVENT)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_LOADED
infrun: resume (step=0, signal=0)
Hardware watchpoint 1: countContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: prepare_to_wait
gdb: kernel event for pid=1444 tid=2104 code=EXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_BREAKPOINT at 0x7c901230
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x7c901231
stopped_data_addr:
	CONTROL (DR7): 00000000          STATUS (DR6): 00000000
	DR0: addr=0x00000000, ref.count=0  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: stopped
infrun: stop_stepping
Loaded symbols for /c/WINDOWS/system32/ntdll.dll
Loaded symbols for /c/WINDOWS/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /c/WINDOWS/system32/advapi32.dll
Loaded symbols for /c/WINDOWS/system32/rpcrt4.dll
infrun: proceed (addr=0xffffffff, signal=0, step=0)
insert_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): 00000000
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: resume (step=0, signal=0)
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: wait_for_inferior
gdb: kernel event for pid=1444 tid=2104 code=LOAD_DLL_DEBUG_EVENT)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_LOADED
infrun: resume (step=0, signal=0)
Hardware watchpoint 1: countContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: prepare_to_wait
gdb: kernel event for pid=1444 tid=2104 code=OUTPUT_DEBUG_STRING_EVENT)
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
gdb: kernel event for pid=1444 tid=fc code=CREATE_THREAD_DEBUG_EVENT)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0)
ContinueDebugEvent (cpid=1444, ctid=252, DBG_CONTINUE);
infrun: prepare_to_wait
gdb: kernel event for pid=1444 tid=2104 code=OUTPUT_DEBUG_STRING_EVENT)
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
gdb: kernel event for pid=1444 tid=2104 code=LOAD_DLL_DEBUG_EVENT)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_LOADED
infrun: resume (step=0, signal=0)
Hardware watchpoint 1: countContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: prepare_to_wait
gdb: kernel event for pid=1444 tid=2104 code=LOAD_DLL_DEBUG_EVENT)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_LOADED
infrun: resume (step=0, signal=0)
Hardware watchpoint 1: countContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: prepare_to_wait
gdb: kernel event for pid=1444 tid=2104 code=LOAD_DLL_DEBUG_EVENT)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_LOADED
infrun: resume (step=0, signal=0)
Hardware watchpoint 1: countContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: prepare_to_wait
gdb: kernel event for pid=1444 tid=2104 code=LOAD_DLL_DEBUG_EVENT)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_LOADED
infrun: resume (step=0, signal=0)
Hardware watchpoint 1: countContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: prepare_to_wait
gdb: kernel event for pid=1444 tid=2104 code=EXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_BREAKPOINT at 0x00401075
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x401075
stopped_data_addr:
	CONTROL (DR7): 000d0101          STATUS (DR6): 00000000
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: BPSTAT_WHAT_STOP_NOISY
infrun: stop_stepping
remove_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0100          STATUS (DR6): 00000000
	DR0: addr=0x00000000, ref.count=0  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
main () at test.c:8
8	{
(gdb) c
Continuing.
infrun: proceed (addr=0xffffffff, signal=144, step=0)
insert_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): 00000000
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: resume (step=0, signal=0)
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: wait_for_inferior
gdb: kernel event for pid=1444 tid=2104 code=EXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_SINGLE_STEP at 0x00401099
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x401099
stopped_data_addr:
	CONTROL (DR7): 000d0101          STATUS (DR6): 00000000
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: random signal 5

Program received signal SIGTRAP, Trace/breakpoint trap.
infrun: stop_stepping
remove_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0100          STATUS (DR6): 00000000
	DR0: addr=0x00000000, ref.count=0  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
main () at test.c:11
11	  printf ("count %d\n", count);
(gdb) c
Continuing.
infrun: proceed (addr=0xffffffff, signal=144, step=0)
insert_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): 00000000
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: resume (step=0, signal=0)
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: wait_for_inferior
gdb: kernel event for pid=1444 tid=2104 code=EXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_SINGLE_STEP at 0x004010b9
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x4010b9
watchpoint_hit (addr=403010, len=-1, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: BPSTAT_WHAT_STOP_NOISY
infrun: stop_stepping
remove_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0100          STATUS (DR6): ffff0ff1
	DR0: addr=0x00000000, ref.count=0  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
Hardware watchpoint 1: count

Old value = 0
New value = 1000
main () at test.c:16
16	      printf ("count %d\n", count);
(gdb)
Continuing.
infrun: proceed (addr=0xffffffff, signal=144, step=0)
insert_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: resume (step=0, signal=0)
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: wait_for_inferior
gdb: kernel event for pid=1444 tid=2104 code=EXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_SINGLE_STEP at 0x004010d9
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x4010d9
watchpoint_hit (addr=403010, len=-1, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): 00000001
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: BPSTAT_WHAT_STOP_NOISY
infrun: stop_stepping
remove_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0100          STATUS (DR6): 00000001
	DR0: addr=0x00000000, ref.count=0  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
Hardware watchpoint 1: count

Old value = 1000
New value = 1001
main () at test.c:18
18	      Sleep (1000);
(gdb)
Continuing.
infrun: proceed (addr=0xffffffff, signal=144, step=0)
insert_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): 00000001
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: resume (step=0, signal=0)
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: wait_for_inferior
gdb: kernel event for pid=1444 tid=2104 code=EXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_SINGLE_STEP at 0x004010d9
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x4010d9
watchpoint_hit (addr=403010, len=-1, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: BPSTAT_WHAT_STOP_NOISY
infrun: stop_stepping
remove_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0100          STATUS (DR6): ffff0ff1
	DR0: addr=0x00000000, ref.count=0  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
Hardware watchpoint 1: count

Old value = 1001
New value = 1002
main () at test.c:18
18	      Sleep (1000);
(gdb)
Continuing.
infrun: proceed (addr=0xffffffff, signal=144, step=0)
insert_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: resume (step=0, signal=0)
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: wait_for_inferior
gdb: kernel event for pid=1444 tid=2104 code=EXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_SINGLE_STEP at 0x004010d9
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x4010d9
watchpoint_hit (addr=403010, len=-1, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: BPSTAT_WHAT_STOP_NOISY
infrun: stop_stepping
remove_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0100          STATUS (DR6): ffff0ff1
	DR0: addr=0x00000000, ref.count=0  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
Hardware watchpoint 1: count

Old value = 1002
New value = 1003
main () at test.c:18
18	      Sleep (1000);
(gdb)
Continuing.
infrun: proceed (addr=0xffffffff, signal=144, step=0)
insert_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: resume (step=0, signal=0)
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: wait_for_inferior
gdb: kernel event for pid=1444 tid=2104 code=EXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_SINGLE_STEP at 0x004010d9
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x4010d9
watchpoint_hit (addr=403010, len=-1, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: BPSTAT_WHAT_STOP_NOISY
infrun: stop_stepping
remove_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0100          STATUS (DR6): ffff0ff1
	DR0: addr=0x00000000, ref.count=0  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
Hardware watchpoint 1: count

Old value = 1003
New value = 1004
main () at test.c:18
18	      Sleep (1000);
(gdb)
Continuing.
infrun: proceed (addr=0xffffffff, signal=144, step=0)
insert_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: resume (step=0, signal=0)
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
infrun: wait_for_inferior
gdb: kernel event for pid=1444 tid=2104 code=EXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_SINGLE_STEP at 0x004010d9
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x4010d9
watchpoint_hit (addr=403010, len=-1, type=data-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=0x00403010, ref.count=1  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
infrun: BPSTAT_WHAT_STOP_NOISY
infrun: stop_stepping
remove_watchpoint (addr=403010, len=4, type=data-write):
	CONTROL (DR7): 000d0100          STATUS (DR6): ffff0ff1
	DR0: addr=0x00000000, ref.count=0  DR1: addr=0x00000000, ref.count=0
	DR2: addr=0x00000000, ref.count=0  DR3: addr=0x00000000, ref.count=0
Hardware watchpoint 1: count

Old value = 1004
New value = 1005
main () at test.c:18
18	      Sleep (1000);
(gdb) ki
Kill the program being debugged? (y or n) y
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
ContinueDebugEvent (cpid=1444, ctid=252, DBG_CONTINUE);
ContinueDebugEvent (cpid=1444, ctid=2104, DBG_CONTINUE);
gdb: win32_close, inferior_ptid=2104
(gdb) q
-- 
René Berber


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]