detecting breakpoint type and number

Eli Zaretskii eliz@gnu.org
Thu Jul 15 06:42:00 GMT 2004


> 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.



More information about the Gdb mailing list