This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB 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]

gdb/516: watches on i386 linux fails on second program start.



>Number:         516
>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:04 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:


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