aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-11-09 18:23:52 +0000
committerPedro Alves <palves@redhat.com>2010-11-09 18:23:52 +0000
commita1442452ec3d5cf08e0baefb7aa8691b28ea9682 (patch)
tree926a4ec1c1bedff77e60d06d34b6d0e942f4e86c /gdb/breakpoint.c
parentf625ae503e5bf88c2f5d6b5a34316416f1fd0f9b (diff)
downloadgdb-a1442452ec3d5cf08e0baefb7aa8691b28ea9682.zip
gdb-a1442452ec3d5cf08e0baefb7aa8691b28ea9682.tar.gz
gdb-a1442452ec3d5cf08e0baefb7aa8691b28ea9682.tar.bz2
gdb/
* 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.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c6
1 files changed, 3 insertions, 3 deletions
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);
}