+2003-12-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ * breakpoint.c (breakpoint_enabled): New function to test whether
+ breakpoint is active and enabled.
+ (insert_bp_location, insert_breakpoints): Call new function to test
+ for enabled breakpoint.
+ (remove_breakpoint, breakpoint_here_p, breakpoint_thread_match)
+ (bpstat_should_step, bpstat_have_active_hw_watchpoints)
+ (disable_breakpoints_in_shlibs, hw_watchpoint_used_count)
+ (disable_watchpoints_before_interactive_call_start)
+ (breakpoint_re_set_one): Ditto.
+ (bpstat_stop_status): Use new function and simplify test.
+
2003-12-11 Mark Kettenis <kettenis@gnu.org>
* observer.c (observer_test_first_observer)
error ("catch of library unloads not yet implemented on this platform")
#endif
+/* Return whether a breakpoint is an active enabled breakpoint. */
+static int
+breakpoint_enabled (struct breakpoint *b)
+{
+ return b->enable_state == bp_enabled;
+}
+
/* Set breakpoint count to NUM. */
void
/* Permanent breakpoints cannot be inserted or removed. Disabled
breakpoints should not be inserted. */
- if (bpt->owner->enable_state != bp_enabled)
+ if (!breakpoint_enabled (bpt->owner))
return 0;
if (bpt->inserted || bpt->duplicate)
{
/* Permanent breakpoints cannot be inserted or removed. Disabled
breakpoints should not be inserted. */
- if (b->owner->enable_state != bp_enabled)
+ if (!breakpoint_enabled (b->owner))
continue;
/* FIXME drow/2003-10-07: This code should be pushed elsewhere when
b->inserted = (is == mark_inserted);
}
else if (b->loc_type == bp_loc_hardware_watchpoint
- && b->owner->enable_state == bp_enabled
+ && breakpoint_enabled (b->owner)
&& !b->duplicate)
{
struct value *v;
else if ((b->owner->type == bp_catch_fork ||
b->owner->type == bp_catch_vfork ||
b->owner->type == bp_catch_exec)
- && b->owner->enable_state == bp_enabled
+ && breakpoint_enabled (b->owner)
&& !b->duplicate)
{
val = -1;
}
else if ((b->owner->type == bp_catch_catch ||
b->owner->type == bp_catch_throw)
- && b->owner->enable_state == bp_enabled
+ && breakpoint_enabled (b->owner)
&& !b->duplicate)
{
}
else if (ep_is_exception_catchpoint (b->owner)
&& b->inserted /* sometimes previous insert doesn't happen */
- && b->owner->enable_state == bp_enabled
+ && breakpoint_enabled (b->owner)
&& !b->duplicate)
{
&& bpt->loc_type != bp_loc_hardware_breakpoint)
continue;
- if ((bpt->owner->enable_state == bp_enabled
+ if ((breakpoint_enabled (bpt->owner)
|| bpt->owner->enable_state == bp_permanent)
&& bpt->address == pc) /* bp is enabled and matches pc */
{
&& bpt->loc_type != bp_loc_hardware_breakpoint)
continue;
- if ((bpt->owner->enable_state == bp_enabled
+ if ((breakpoint_enabled (bpt->owner)
|| bpt->owner->enable_state == bp_permanent)
&& bpt->address == pc
&& (bpt->owner->thread == -1 || bpt->owner->thread == thread))
ALL_BREAKPOINTS_SAFE (b, temp)
{
- if (b->enable_state == bp_disabled
- || b->enable_state == bp_shlib_disabled
- || b->enable_state == bp_call_disabled)
+ if (!breakpoint_enabled (b) && b->enable_state != bp_permanent)
continue;
if (b->type != bp_watchpoint
{
struct breakpoint *b;
ALL_BREAKPOINTS (b)
- if (b->enable_state == bp_enabled && b->type == bp_watchpoint)
+ if (breakpoint_enabled (b) && b->type == bp_watchpoint)
return 1;
return 0;
}
{
struct bp_location *bpt;
ALL_BP_LOCATIONS (bpt)
- if ((bpt->owner->enable_state == bp_enabled)
+ if (breakpoint_enabled (bpt->owner)
&& bpt->inserted
&& bpt->loc_type == bp_loc_hardware_watchpoint)
return 1;
#if defined (PC_SOLIB)
if (((b->type == bp_breakpoint) ||
(b->type == bp_hardware_breakpoint)) &&
- b->enable_state == bp_enabled &&
+ breakpoint_enabled (b) &&
!b->loc->duplicate &&
PC_SOLIB (b->loc->address))
{
*other_type_used = 0;
ALL_BREAKPOINTS (b)
{
- if (b->enable_state == bp_enabled)
+ if (breakpoint_enabled (b))
{
if (b->type == type)
i++;
else if ((b->type == bp_hardware_watchpoint ||
b->type == bp_read_watchpoint ||
- b->type == bp_access_watchpoint)
- && b->enable_state == bp_enabled)
+ b->type == bp_access_watchpoint))
*other_type_used = 1;
}
}
|| (b->type == bp_read_watchpoint)
|| (b->type == bp_access_watchpoint)
|| ep_is_exception_catchpoint (b))
- && (b->enable_state == bp_enabled))
+ && breakpoint_enabled (b))
{
b->enable_state = bp_call_disabled;
check_duplicates (b);
value_free (b->val);
b->val = evaluate_expression (b->exp);
release_value (b->val);
- if (VALUE_LAZY (b->val) && b->enable_state == bp_enabled)
+ if (VALUE_LAZY (b->val) && breakpoint_enabled (b))
value_fetch_lazy (b->val);
if (b->cond_string != NULL)
xfree (b->cond);
b->cond = parse_exp_1 (&s, (struct block *) 0, 0);
}
- if (b->enable_state == bp_enabled)
+ if (breakpoint_enabled (b))
mention (b);
value_free_to_mark (mark);
break;