+2007-10-11 Daniel Jacobowitz <dan@codesourcery.com>
+ Kazu Hirata <kazu@codesourcery.com>
+
+ * breakpoint.c (do_enable_breakpoint): Delay enabling until after
+ checking watchpoint resources.
+
2007-10-11 Kazu Hirata <kazu@codesourcery.com>
* memattr.c (inaccessible_by_default): Change the initial
error (_("Hardware breakpoints used exceeds limit."));
}
- if (bpt->enable_state != bp_permanent)
- bpt->enable_state = bp_enabled;
- bpt->disposition = disposition;
- check_duplicates (bpt);
- breakpoints_changed ();
-
if (bpt->type == bp_watchpoint ||
bpt->type == bp_hardware_watchpoint ||
bpt->type == bp_read_watchpoint ||
printf_filtered (_("\
Cannot enable watchpoint %d because the block in which its expression\n\
is valid is not currently in scope.\n"), bpt->number);
- bpt->enable_state = bp_disabled;
return;
}
select_frame (fr);
}
- value_free (bpt->val);
+ if (bpt->val)
+ value_free (bpt->val);
mark = value_mark ();
bpt->val = evaluate_expression (bpt->exp);
release_value (bpt->val);
printf_filtered (_("\
Cannot enable watchpoint %d because target watch resources\n\
have been allocated for other watchpoints.\n"), bpt->number);
- bpt->enable_state = bp_disabled;
value_free_to_mark (mark);
return;
}
value_free_to_mark (mark);
}
+ if (bpt->enable_state != bp_permanent)
+ bpt->enable_state = bp_enabled;
+ bpt->disposition = disposition;
+ check_duplicates (bpt);
+ breakpoints_changed ();
+
if (deprecated_modify_breakpoint_hook)
deprecated_modify_breakpoint_hook (bpt);
breakpoint_modify_event (bpt->number);