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]

Re: gdb/331: watch is finicky about giving a hardware watchpoint


The following reply was made to PR gdb/331; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@mvista.com>
To: dru-gdb@redwoodsoft.com
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/331: watch is finicky about giving a hardware watchpoint
Date: Sat, 2 Feb 2002 17:56:18 -0500

 On Sat, Feb 02, 2002 at 10:41:42PM -0000, dru-gdb@redwoodsoft.com wrote:
 > 
 > >Number:         331
 > >Category:       gdb
 > >Synopsis:       watch is finicky about giving a hardware watchpoint
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    unassigned
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Sat Feb 02 14:48:01 PST 2002
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Dru
 > >Release:        gdb 5.1.1
 > >Organization:
 > >Environment:
 > linux 2.2.16 (patched with jcrown debug register patches)
 > x86
 > >Description:
 > When I set a watch to a named variable, gdb will create a 
 > 'hardware watchpoint'. However if I issue:
 > 'watch 0x81d79a8' gdb creates a software watchpoint. 
 > This is annoying since I'm debugging after a segmentation
 > violation and I need to re-run the program to see who is
 > writing to that memory. 
 > 
 > Why isn't this a valid expression to create a hardware
 > watchpoint that doesn't rely on variable scope?
 
 That's watching the value of '0x81d79a8'.  A constant.  You want:
 watch *(int *)0x81d79a8
 
 which should create a hardware watchpoint.
 
 I agree we should warn about this.
 
 -- 
 Daniel Jacobowitz                           Carnegie Mellon University
 MontaVista Software                         Debian GNU/Linux Developer


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