This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Warn on constant value watchpoints
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 08 Jun 2008 21:04:43 +0300
- Subject: Re: [patch] Warn on constant value watchpoints
- References: <20080608155302.GA25486@host0.dyn.jankratochvil.net>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Sun, 8 Jun 2008 17:53:02 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
>
>
> --tKW2IUtsqtDRztdT
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
>
> Hi,
>
> idea came from a discussion with the Firefox maintainer Martin Stransky who had
> disfunctional watchpoint on the address of a variable:
>
> (gdb) watch 0x4343548
> Watchpoint 1: 70530376
Should we allow such watchpoints? under what circumstances are they
useful?
> + if (v == NULL && !query
> + (_("Do you insist on this watchpoint with a constant value? ")))
I think a better text for this question would be
Really watch constant value %s?
> +If you watch for a change in a numerically entered address you need to
> +dereference it as the address itself is just a constant number which will never
> +change:
> +
> +@smallexample
> +(@value{GDBP}) watch 0x600850
> +Do you insist on this watchpoint with a constant value? (y or n) n
> +Watchpoint with a constant value was cancelled.
> +(@value{GDBP}) watch *(int *) 0x600850
> +Watchpoint 1: *(int *) 6293584
> +@end smallexample
Thanks, but please mention in the text that GDB asks for confirmation
because watching a constant value is not generally useful. Otherwise,
the example might not be fully understood.
Other than that, the patch for the manual is approved (assuming the
code is approved).