delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/10/13/21:20:29

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: =?ISO-8859-1?Q?Ren=E9_Berber?= <r DOT berber AT computer DOT org>
Subject: Re: [gdb] Data watchpoints in Windows weirdness. Call for testers.
Date: Sat, 13 Oct 2007 20:19:40 -0500
Lines: 275
Message-ID: <ferqrc$ndc$1@ger.gmane.org>
References: <4702E6B7 DOT 8020100 AT portugalmail DOT pt> <20071008124331 DOT GD19254 AT calimero DOT vinschen DOT de> <20071008143552 DOT GA20746 AT ednor DOT casa DOT cgf DOT cx> <47115BEF DOT 7030407 AT portugalmail DOT pt>
Mime-Version: 1.0
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
In-Reply-To: <47115BEF.7030407@portugalmail.pt>
OpenPGP: url=hkp://wwwkeys.pgp.net
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Pedro Alves wrote:

[snip]
> Any change someone does the little testing to make sure I'm not
> having a local problem here?
>=20
> as easy as:
>=20
> gcc main.c -o main.exe -g3 -O0
> gdb main.exe
> start
> watch count
> 'continue' several times, and send me or post here the results.
>=20
> A log with the these on would be nice, but not essencial:
> set debug infrun 1
> set debugevents 1
> set debugexceptions 1
> maint show-debug-regs 1

$ gcc main.c -o main.exe -g3 -O0

rberber AT black /c/tmp
$ gdb main.exe
GNU gdb 6.5.50.20060706-cvs (cygwin-special)
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 condition=
s.
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) start
Breakpoint 1 at 0x401075: file main.c, line 8.
Starting program: /c/tmp/main.exe
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
main ()
    at main.c:8
8	{
(gdb) watch count
Hardware watchpoint 2: count
(gdb) c
Continuing.

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

Program received signal SIGTRAP, Trace/breakpoint trap.
main () at main.c:16
16	      printf ("count %d\n", count);
(gdb) p count
$1 =3D 1000
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
main () at main.c:18
18	      Sleep (1000);
(gdb) p count
$3 =3D 1001
(gdb) c
Continuing.
Hardware watchpoint 2: count

Old value =3D 0
New value =3D 1002
main () at main.c:18
18	      Sleep (1000);
(gdb) c
Continuing.
Hardware watchpoint 2: count

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

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

Old value =3D 1004
New value =3D 1005
main () at main.c:18
18	      Sleep (1000);
(gdb) c
Continuing.
Hardware watchpoint 2: count

Old value =3D 1005
New value =3D 1006
main () at main.c:18
18	      Sleep (1000);
(gdb) set debug infrun 1
(gdb) set debugevents 1
(gdb) set debugexceptions 1
(gdb) maint show-debug-regs 1
(gdb) c
Continuing.
infrun: proceed (addr=3D0xffffffff, signal=3D144, step=3D0)
insert_watchpoint (addr=3D403010, len=3D4, type=3Ddata-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=3D0x00403010, ref.count=3D1  DR1: addr=3D0x00000000, ref.count=
=3D0
	DR2: addr=3D0x00000000, ref.count=3D0  DR3: addr=3D0x00000000, ref.count=
=3D0
infrun: resume (step=3D0, signal=3D0)
ContinueDebugEvent (cpid=3D1548, ctid=3D1364, DBG_CONTINUE);
infrun: wait_for_inferior
gdb: kernel event for pid=3D1548 tid=3D1364 code=3DEXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_SINGLE_STEP at 0x004010d9
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc =3D 0x4010d9
watchpoint_hit (addr=3D403010, len=3D-1, type=3Ddata-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=3D0x00403010, ref.count=3D1  DR1: addr=3D0x00000000, ref.count=
=3D0
	DR2: addr=3D0x00000000, ref.count=3D0  DR3: addr=3D0x00000000, ref.count=
=3D0
infrun: BPSTATE_WHAT_STOP_NOISY
infrun: stop_stepping
remove_watchpoint (addr=3D403010, len=3D4, type=3Ddata-write):
	CONTROL (DR7): 000d0100          STATUS (DR6): ffff0ff1
	DR0: addr=3D0x00000000, ref.count=3D0  DR1: addr=3D0x00000000, ref.count=
=3D0
	DR2: addr=3D0x00000000, ref.count=3D0  DR3: addr=3D0x00000000, ref.count=
=3D0
Hardware watchpoint 2: count

Old value =3D 1006
New value =3D 1007
main () at main.c:18
18	      Sleep (1000);
(gdb) c
Continuing.
infrun: proceed (addr=3D0xffffffff, signal=3D144, step=3D0)
insert_watchpoint (addr=3D403010, len=3D4, type=3Ddata-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=3D0x00403010, ref.count=3D1  DR1: addr=3D0x00000000, ref.count=
=3D0
	DR2: addr=3D0x00000000, ref.count=3D0  DR3: addr=3D0x00000000, ref.count=
=3D0
infrun: resume (step=3D0, signal=3D0)
ContinueDebugEvent (cpid=3D1548, ctid=3D1364, DBG_CONTINUE);
infrun: wait_for_inferior
gdb: kernel event for pid=3D1548 tid=3D1364 code=3DEXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_SINGLE_STEP at 0x004010d9
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc =3D 0x4010d9
watchpoint_hit (addr=3D403010, len=3D-1, type=3Ddata-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=3D0x00403010, ref.count=3D1  DR1: addr=3D0x00000000, ref.count=
=3D0
	DR2: addr=3D0x00000000, ref.count=3D0  DR3: addr=3D0x00000000, ref.count=
=3D0
infrun: BPSTATE_WHAT_STOP_NOISY
infrun: stop_stepping
remove_watchpoint (addr=3D403010, len=3D4, type=3Ddata-write):
	CONTROL (DR7): 000d0100          STATUS (DR6): ffff0ff1
	DR0: addr=3D0x00000000, ref.count=3D0  DR1: addr=3D0x00000000, ref.count=
=3D0
	DR2: addr=3D0x00000000, ref.count=3D0  DR3: addr=3D0x00000000, ref.count=
=3D0
Hardware watchpoint 2: count

Old value =3D 1007
New value =3D 1008
main () at main.c:18
18	      Sleep (1000);
(gdb) c
Continuing.
infrun: proceed (addr=3D0xffffffff, signal=3D144, step=3D0)
insert_watchpoint (addr=3D403010, len=3D4, type=3Ddata-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=3D0x00403010, ref.count=3D1  DR1: addr=3D0x00000000, ref.count=
=3D0
	DR2: addr=3D0x00000000, ref.count=3D0  DR3: addr=3D0x00000000, ref.count=
=3D0
infrun: resume (step=3D0, signal=3D0)
ContinueDebugEvent (cpid=3D1548, ctid=3D1364, DBG_CONTINUE);
infrun: wait_for_inferior
gdb: kernel event for pid=3D1548 tid=3D1364 code=3DEXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_SINGLE_STEP at 0x004010d9
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc =3D 0x4010d9
watchpoint_hit (addr=3D403010, len=3D-1, type=3Ddata-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=3D0x00403010, ref.count=3D1  DR1: addr=3D0x00000000, ref.count=
=3D0
	DR2: addr=3D0x00000000, ref.count=3D0  DR3: addr=3D0x00000000, ref.count=
=3D0
infrun: BPSTATE_WHAT_STOP_NOISY
infrun: stop_stepping
remove_watchpoint (addr=3D403010, len=3D4, type=3Ddata-write):
	CONTROL (DR7): 000d0100          STATUS (DR6): ffff0ff1
	DR0: addr=3D0x00000000, ref.count=3D0  DR1: addr=3D0x00000000, ref.count=
=3D0
	DR2: addr=3D0x00000000, ref.count=3D0  DR3: addr=3D0x00000000, ref.count=
=3D0
Hardware watchpoint 2: count

Old value =3D 1008
New value =3D 1009
main () at main.c:18
18	      Sleep (1000);
(gdb) c
Continuing.
infrun: proceed (addr=3D0xffffffff, signal=3D144, step=3D0)
insert_watchpoint (addr=3D403010, len=3D4, type=3Ddata-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=3D0x00403010, ref.count=3D1  DR1: addr=3D0x00000000, ref.count=
=3D0
	DR2: addr=3D0x00000000, ref.count=3D0  DR3: addr=3D0x00000000, ref.count=
=3D0
infrun: resume (step=3D0, signal=3D0)
ContinueDebugEvent (cpid=3D1548, ctid=3D1364, DBG_CONTINUE);
infrun: wait_for_inferior
gdb: kernel event for pid=3D1548 tid=3D1364 code=3DEXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_SINGLE_STEP at 0x004010d9
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc =3D 0x4010d9
watchpoint_hit (addr=3D403010, len=3D-1, type=3Ddata-write):
	CONTROL (DR7): 000d0101          STATUS (DR6): ffff0ff1
	DR0: addr=3D0x00403010, ref.count=3D1  DR1: addr=3D0x00000000, ref.count=
=3D0
	DR2: addr=3D0x00000000, ref.count=3D0  DR3: addr=3D0x00000000, ref.count=
=3D0
infrun: BPSTATE_WHAT_STOP_NOISY
infrun: stop_stepping
remove_watchpoint (addr=3D403010, len=3D4, type=3Ddata-write):
	CONTROL (DR7): 000d0100          STATUS (DR6): ffff0ff1
	DR0: addr=3D0x00000000, ref.count=3D0  DR1: addr=3D0x00000000, ref.count=
=3D0
	DR2: addr=3D0x00000000, ref.count=3D0  DR3: addr=3D0x00000000, ref.count=
=3D0
Hardware watchpoint 2: count

Old value =3D 1009
New value =3D 1010
main () at main.c:18
18	      Sleep (1000);
(gdb) ki
Kill the program being debugged? (y or n) y
ContinueDebugEvent (cpid=3D1548, ctid=3D1364, DBG_CONTINUE);
ContinueDebugEvent (cpid=3D1548, ctid=3D1364, DBG_CONTINUE);
ContinueDebugEvent (cpid=3D1548, ctid=3D3808, DBG_CONTINUE);
gdb: win32_close, inferior_ptid=3D1364
(gdb) q

--=20
Ren=E9 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019