aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/breakpoint.c6
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/watchpoint.exp5
4 files changed, 20 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index affffde..10c635f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-09 Pedro Alves <pedro@codesourcery.com>
+
+ * 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 <jan.kratochvil@redhat.com>
* infrun.c (restore_inferior_thread_state): Use
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index b4502e7..ffa8c52 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -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);
}
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 1eacf9d..dae986b 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-09 Pedro Alves <pedro@codesourcery.com>
+
+ * gdb.base/watchpoint.exp: Test "watch -location" with an
+ innacessible location.
+
2010-11-09 Edjunior Machado <emachado@br.ibm.com>
Luis Machado <luisgpm@br.ibm.com>
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
index 6721bda..0a82969 100644
--- a/gdb/testsuite/gdb.base/watchpoint.exp
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -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-*] {