Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.653 diff -d -u -r1.653 breakpoint.c --- breakpoint.c 18 Feb 2012 17:10:32 -0000 1.653 +++ breakpoint.c 21 Feb 2012 21:34:45 -0000 @@ -8831,6 +8831,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 Index: testsuite/gdb.base/watchpoint.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/watchpoint.exp,v retrieving revision 1.53 diff -d -u -r1.53 watchpoint.exp --- testsuite/gdb.base/watchpoint.exp 13 Feb 2012 18:09:59 -0000 1.53 +++ testsuite/gdb.base/watchpoint.exp 21 Feb 2012 21:34:51 -0000 @@ -559,6 +559,8 @@ proc test_constant_watchpoint {} { gdb_test "watch 5" "Cannot watch constant value `5'." "number is constant" + gdb_test "watch (int *)5" "Cannot watch constant value `\\(int \\*\\)5'." \ + "number with cast is constant" gdb_test "watch marker1" "Cannot watch constant value `marker1'." \ "marker1 is constant" gdb_test "watch count + 6" ".*atchpoint \[0-9\]+: count \\+ 6"