This is the mail archive of the gdb@sourceware.org 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: Watchpoints with condition


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


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