* breakpoint.{c,h}: Add exp_string to struct breakpoint and use
[deliverable/binutils-gdb.git] / gdb / breakpoint.c
index c907f77131d04c33c0d26577723139ed79eeef26..90e01eec266a0e351f9171cc7c95f64126a0b9c1 100644 (file)
@@ -1625,6 +1625,7 @@ watch_command (arg, from_tty)
   b->val = val;
   b->cond = 0;
   b->cond_string = NULL;
+  b->exp_string = savestring (arg, strlen (arg));
   mention (b);
 }
 \f
@@ -2143,6 +2144,8 @@ delete_breakpoint (bpt)
     free ((PTR)bpt->cond_string);
   if (bpt->addr_string != NULL)
     free ((PTR)bpt->addr_string);
+  if (bpt->exp_string != NULL)
+    free ((PTR)bpt->exp_string);
 
   if (xgdb_verbose && bpt->type == bp_breakpoint)
     printf ("breakpoint #%d deleted\n", bpt->number);
@@ -2235,11 +2238,20 @@ breakpoint_re_set_one (bint)
       break;
 
     case bp_watchpoint:
+      innermost_block = NULL;
+      b->exp = parse_expression (b->exp_string);
+      b->exp_valid_block = innermost_block;
+      b->val = evaluate_expression (b->exp);
+      release_value (b->val);
+      if (VALUE_LAZY (b->val))
+       value_fetch_lazy (b->val);
+
       if (b->cond_string != NULL)
        {
          s = b->cond_string;
          b->cond = parse_exp_1 (&s, (struct block *)0, 0);
        }
+      mention (b);
       break;
 
     default:
This page took 0.023739 seconds and 4 git commands to generate.