This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/515: watches on i386 linux fails on second program start.
- From: muller at ics dot u-strasbg dot fr
- To: gdb-gnats at sources dot redhat dot com
- Cc: eliz at is dot elta dot co dot il
- Date: 30 Apr 2002 15:28:05 -0000
- Subject: gdb/515: watches on i386 linux fails on second program start.
- Reply-to: muller at ics dot u-strasbg dot fr
>Number: 515
>Category: gdb
>Synopsis: watches on i386 linux fails on second program start.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Apr 30 08:38:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Pierre Muller
>Release: GNU gdb 5.2
>Organization:
>Environment:
Linux backserver 2.4.18 #2 Fre Apr 19 17:45:12 CEST 2002 i686 unknown
>Description:
If you set a watchpoint under i386 linux,
the watchpoint becomes uneffective after a
restart of the debuggee.
>How-To-Repeat:
Compile the following tiny source on a i386 linux box,
int x = 5;
int
main ()
{
x = 8;
return 0;
}
run gdb 5.2 with the created executable
(gdb)watch{or awatch} x
(gdb)run
it will stop saying that x value change from 5 to 8.
(gdb) cont
Program exited normally.
(gdb) run
Program exited normally.
No stop anymore...
>Fix:
The problem is that dr_ref_count is left to value one
when the program is stopped. Thus a second run, this
ref count is incremented to two, but no debug registers
are changed, as GDB believes that there is already a register
containing that addr.
Can be fixed by calling i386_cleanup_dregs,
which is not called by the linux code
(on win32-nat or go32-nat where this function is called,
this bug does not arise).
>Release-Note:
>Audit-Trail:
>Unformatted: