ChangeLog
authorSterling Augustine <saugustine@google.com>
Wed, 22 Feb 2012 18:20:38 +0000 (18:20 +0000)
committerSterling Augustine <saugustine@google.com>
Wed, 22 Feb 2012 18:20:38 +0000 (18:20 +0000)
2012-02-22  Sterling Augustine  <saugustine@google.com>

PR 13689:
* breakpoint.c (watchpoint_exp_is_constant): Add UNOP_CAST to switch.

testsuite/ChangeLog
2012-02-22  Sterling Augustine  <saugustine@google.com>

* gdb.base/watchpoint.exp (test_constant_watchpoint): Add test for
constant with cast.

gdb/ChangeLog
gdb/breakpoint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/watchpoint.exp

index 1fa85dbe6e4df090006fcc40987075e6673f7873..8f0e350f4478386f634951930f6bd5638475fe4c 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-22  Sterling Augustine  <saugustine@google.com>
+
+       PR 13689:
+       * breakpoint.c (watchpoint_exp_is_constant): Add UNOP_CAST to switch.
+
 2012-02-22  Gary Benson  <gbenson@redhat.com>
 
        * dwarf2read.c (dwarf2_read_index): Correct misspelling.
index fed62d6be743214af30379234c2d338b2d4267df..37401575e7381da8e496298b99f66c2d4638181b 100644 (file)
@@ -8831,6 +8831,7 @@ watchpoint_exp_is_const (const struct expression *exp)
        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 9127b183c4c45831d3cc8dc29070c2a148bf63e4..ab3518ada66478e127a1a2c9aae4f762e97f1f78 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-22  Sterling Augustine  <saugustine@google.com>
+
+       * gdb.base/watchpoint.exp (test_constant_watchpoint): Add test for
+       constant with cast.
+
 2012-02-21  Pedro Alves  <palves@redhat.com>
 
        * gdb.threads/watchpoint-fork.exp (test): Use with_test_prefix.
index 7200f71edf83323b15373048a2f23616ec77abec..15482fab7c44d3e178572f4a492970d99186df8d 100644 (file)
@@ -559,6 +559,8 @@ proc test_watchpoint_and_breakpoint {} {
 
 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"