summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Muller <muller@ics.u-strasbg.fr>2002-08-30 07:14:19 +0000
committerPierre Muller <muller@ics.u-strasbg.fr>2002-08-30 07:14:19 +0000
commit1b9c511993ba4c3428b986a4ab33778aed66ffc5 (patch)
tree1837f8c0555670cf40e2b143108976909c5cc620
parent157b8e3994b99744ef8a6c2c3ebf13f8474b56bb (diff)
downloadgdb-1b9c511993ba4c3428b986a4ab33778aed66ffc5.tar.gz
2002-08-30 Pierre Muller <muller@ics.u-strasbg.fr>
* breakpoint.c (breakpoint_init_inferior): Reset the val field of watchpoints to NULL. (insert_breakpoints): set val field of watchpoints if NULL.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/breakpoint.c22
2 files changed, 28 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7d40d33b167..aea6c45a6ca 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2002-08-30 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * breakpoint.c (breakpoint_init_inferior): Reset the val field of
+ watchpoints to NULL.
+ (insert_breakpoints): set val field of watchpoints if NULL.
+
+
2002-08-29 Jim Blandy <jimb@redhat.com>
* symtab.c (lookup_symbol_aux): In the cases where we find a
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index c52b4ba0032..b88f6749aec 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -738,7 +738,19 @@ insert_breakpoints (void)
if (b->enable_state == bp_permanent)
/* Permanent breakpoints cannot be inserted or removed. */
continue;
- else if (b->type != bp_watchpoint
+ if ((b->type == bp_watchpoint
+ || b->type == bp_hardware_watchpoint
+ || b->type == bp_read_watchpoint
+ || b->type == bp_access_watchpoint) && (!b->val))
+ {
+ struct value *val;
+ val = evaluate_expression (b->exp);
+ release_value (val);
+ if (VALUE_LAZY (val))
+ value_fetch_lazy (val);
+ b->val = val;
+ }
+ if (b->type != bp_watchpoint
&& b->type != bp_hardware_watchpoint
&& b->type != bp_read_watchpoint
&& b->type != bp_access_watchpoint
@@ -1566,6 +1578,14 @@ breakpoint_init_inferior (enum inf_context context)
/* Likewise for watchpoints on local expressions. */
if (b->exp_valid_block != NULL)
delete_breakpoint (b);
+ if (context == inf_starting)
+ {
+ /* Reset val field to force reread of starting value
+ in insert_breakpoints. */
+ if (b->val)
+ value_free (b->val);
+ b->val = NULL;
+ }
break;
default:
/* Likewise for exception catchpoints in dynamic-linked