This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Watchpoints with condition
- From: Daniel Jacobowitz <drow at false dot org>
- To: Vladimir Prus <vladimir at codesourcery dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Fri, 30 Nov 2007 11:37:45 -0500
- Subject: Re: Watchpoints with condition
- References: <200711301925.20196.vladimir@codesourcery.com>
On Fri, Nov 30, 2007 at 07:25:19PM +0300, Vladimir Prus wrote:
>
> GDB presently allow a watchpoint to have a condition, and I wonder
> what are the use-cases for that.
>
> If anybody has used watchpoint in condition in practice when debugging
> real problem (as opposed to just playing with gdb, or making up
> possible uses), can he share why it was needed?
I haven't, but here's a use case: if the condition is something you
couldn't set a watchpoint on or would take too many hardware resources
to watch. E.g.
set $name = "my_function"
watch global_variable if strcmp (cfun->name, $name) == 0
--
Daniel Jacobowitz
CodeSourcery