]> Git Repo - binutils.git/commitdiff
gdb/
authorPedro Alves <[email protected]>
Tue, 9 Nov 2010 18:23:52 +0000 (18:23 +0000)
committerPedro Alves <[email protected]>
Tue, 9 Nov 2010 18:23:52 +0000 (18:23 +0000)
* breakpoint.c (watch_command_1): Get a pointer of the lazy
version of the expression's value, even if reading the value from
memory fails.  When creating a -location watchpoint, get the
value's address from the lazy value pointer.

gdb/testsuite/
* gdb.base/watchpoint.exp: Test "watch -location" with an
innacessible location.

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

index affffde8fea5edbb53d5f8061996dd0383380786..10c635f534c4e532527a073cf42e4ecb4c3d3a04 100644 (file)
@@ -1,3 +1,10 @@
+2010-11-09  Pedro Alves  <[email protected]>
+
+       * breakpoint.c (watch_command_1): Get a pointer of the lazy
+       version of the expression's value, even if reading the value from
+       memory fails.  When creating a -location watchpoint, get the
+       value's address from the lazy value pointer.
+
 2010-11-07  Jan Kratochvil  <[email protected]>
 
        * infrun.c (restore_inferior_thread_state): Use
index b4502e7057d1563004f5032fa5bc3e8a39950609..ffa8c52026dcccf23cb308f24246791f16ddf1fe 100644 (file)
@@ -8022,7 +8022,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty, int just_location)
   struct breakpoint *b, *scope_breakpoint = NULL;
   struct expression *exp;
   struct block *exp_valid_block = NULL, *cond_exp_valid_block = NULL;
-  struct value *val, *mark;
+  struct value *val, *mark, *result;
   struct frame_info *frame;
   char *exp_start = NULL;
   char *exp_end = NULL;
@@ -8121,12 +8121,12 @@ watch_command_1 (char *arg, int accessflag, int from_tty, int just_location)
 
   exp_valid_block = innermost_block;
   mark = value_mark ();
-  fetch_subexp_value (exp, &pc, &val, NULL, NULL);
+  fetch_subexp_value (exp, &pc, &val, &result, NULL);
 
   if (just_location)
     {
       exp_valid_block = NULL;
-      val = value_addr (val);
+      val = value_addr (result);
       release_value (val);
       value_free_to_mark (mark);
     }
index 1eacf9db50c46e83a2ad7a1b9ea87b10ea8e8b59..dae986b6285eeb351829082dff5241fee9c4b7ca 100644 (file)
@@ -1,3 +1,8 @@
+2010-11-09  Pedro Alves  <[email protected]>
+
+       * gdb.base/watchpoint.exp: Test "watch -location" with an
+       innacessible location.
+
 2010-11-09  Edjunior Machado  <[email protected]>
            Luis Machado  <[email protected]>
 
index 6721bdac534b7bef8a89561de3168af699cfa60d..0a829691e6660af3369fbac6a5488846e38ac43a 100644 (file)
@@ -683,6 +683,11 @@ proc test_inaccessible_watchpoint {} {
            "$watchpoint_msg \[0-9\]+: \\*\\(int \\*\\) 0"
        delete_breakpoints
 
+       # The same, but using -location through an indirection.
+       gdb_test "watch -location *global_ptr" \
+           "$watchpoint_msg \[0-9\]+: \-location: \\*global_ptr"
+       delete_breakpoints
+
        # This step requires two HW watchpoints.  Since PPC Server only has
        # a single one, it will use a SW watchpoint in this case.
        if [istarget powerpc64-*] {
This page took 0.118565 seconds and 4 git commands to generate.