diff options
author | Kazu Hirata <kazu@codesourcery.com> | 2007-10-11 20:19:37 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@codesourcery.com> | 2007-10-11 20:19:37 +0000 |
commit | b4c291bb6d7cef9849c487f5d9f717a49eed996d (patch) | |
tree | b0b19dd5c725240814f5729a592284d39bbb6d7c | |
parent | 56cf5405c3df898925458f8e72938583ceb5f293 (diff) | |
download | gdb-b4c291bb6d7cef9849c487f5d9f717a49eed996d.zip gdb-b4c291bb6d7cef9849c487f5d9f717a49eed996d.tar.gz gdb-b4c291bb6d7cef9849c487f5d9f717a49eed996d.tar.bz2 |
* breakpoint.c (do_enable_breakpoint): Delay enabling until after
checking watchpoint resources.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/breakpoint.c | 17 |
2 files changed, 14 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7408d08..010a42c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index a5990ba..ba56edb 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -8094,12 +8094,6 @@ do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition) 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 || @@ -8117,13 +8111,13 @@ do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition) 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); @@ -8148,7 +8142,6 @@ is valid is not currently in scope.\n"), bpt->number); 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; } @@ -8158,6 +8151,12 @@ have been allocated for other watchpoints.\n"), bpt->number); 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); |