This is the mail archive of the gdb-patches@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: [PATCH] Fix for Bug 13689: watch (cast) 0xf00bar is not caught as "Cannot watch constant value"


Sterling,


> The enclosed one-line fix for bug 13689 simply adds UNOP_CAST as a
> known unary operator to the function watchpoint_exp_is_constant. So
> instead of being conservative and guessing that the expression can
> change, the function continues its analysis. This is identical
> handling to the other unary operators.

Thanks for the fix.

> 2012-02-17  Sterling Augustine  <saugustine@google.com>
> 
> 	PR 13689:
> 	* breakpoint.c (watch_exp_is_constant): Add UNOP_CAST to switch.

The fix looks correct to me. Did you run the testsuite to verify
your change? It's always a good idea to let us know that you did
(and on which platform).

The name of the function you quoted in the ChangeLog is actually
"watchpoint_exp_is_const", so can you correct the ChangeLog?

Also, would you mind adding a test in gdb.base/watchpoint.exp.
There are already some tests that verify that you cannot watch
certain constant expressions, so if you can add one beside it,
that would be awesome.

Thank you!

> Index: breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.652
> diff -d -u -r1.652 breakpoint.c
> --- breakpoint.c	14 Feb 2012 23:28:14 -0000	1.652
> +++ breakpoint.c	17 Feb 2012 23:35:18 -0000
> @@ -8830,6 +8830,7 @@
>  	case UNOP_COMPLEMENT:
>  	case UNOP_ADDR:
>  	case UNOP_HIGH:
> +	case UNOP_CAST:
>  	  /* Unary, binary and ternary operators: We have to check
>  	     their operands.  If they are constant, then so is the
>  	     result of that operation.  For instance, if A and B are


-- 
Joel


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