This is the mail archive of the gdb@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: detecting breakpoint type and number


> Date: Wed, 14 Jul 2004 20:01:07 -0300 (ART)
> From: =?iso-8859-1?q?Charlls=20Quarra?= <charlls_quarra@yahoo.com.ar>
> 
>  I have a script that continues on a watchpointed
> variable untils its value becomes something expected.
> the script looks like this:
> 
> define bla
>  set $conti=1
>  while $conti==1
>   set $u=*(int*)$address
>   if $u==<expected_value> 
>    set $conti=0
>    else
>    cont
>    end
>   end
>  end

I don't understand why you need this.  You could simply specify the
condition when you set the watchpoint:

  (gdb) watch *(int*)$address if *(int*)$address == <expected_value>

or use the `condition' command (which see) for an already existing
watchpoint.


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