This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: detecting breakpoint type and number
- From: "Eli Zaretskii" <eliz at gnu dot org>
- To: charlls_quarra at yahoo dot com dot ar
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 15 Jul 2004 06:51:35 +0200
- Subject: Re: detecting breakpoint type and number
- References: <20040714230107.40234.qmail@web41813.mail.yahoo.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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.