typedef struct
{
enum exception_event_kind kind;
- int enable;
+ int enable_p;
}
args_for_catchpoint_enable;
ALL_BREAKPOINTS_SAFE (b, temp)
{
- if (b->enable == permanent)
+ if (b->enable_state == bp_permanent)
/* Permanent breakpoints cannot be inserted or removed. */
continue;
else if (b->type != bp_watchpoint
&& b->type != bp_catch_exec
&& b->type != bp_catch_throw
&& b->type != bp_catch_catch
- && b->enable != disabled
- && b->enable != shlib_disabled
- && b->enable != call_disabled
+ && b->enable_state != bp_disabled
+ && b->enable_state != bp_shlib_disabled
+ && b->enable_state != bp_call_disabled
&& !b->inserted
&& !b->duplicate)
{
{
/* See also: disable_breakpoints_in_shlibs. */
val = 0;
- b->enable = shlib_disabled;
+ b->enable_state = bp_shlib_disabled;
if (!disabled_breaks)
{
target_terminal_ours_for_output ();
return_val = val; /* remember failure */
}
else if (ep_is_exception_catchpoint (b)
- && b->enable != disabled
- && b->enable != shlib_disabled
- && b->enable != call_disabled
+ && b->enable_state != bp_disabled
+ && b->enable_state != bp_shlib_disabled
+ && b->enable_state != bp_call_disabled
&& !b->inserted
&& !b->duplicate)
target_terminal_ours_for_output ();
warning ("Cannot insert catchpoint %d; disabling it.",
b->number);
- b->enable = disabled;
+ b->enable_state = bp_disabled;
}
else
{
args_for_catchpoint_enable args;
args.kind = b->type == bp_catch_catch ?
EX_EVENT_CATCH : EX_EVENT_THROW;
- args.enable = 1;
+ args.enable_p = 1;
val = catch_errors (cover_target_enable_exception_callback,
&args,
message, RETURN_MASK_ALL);
target_terminal_ours_for_output ();
warning ("Cannot insert catchpoint %d; disabling it.",
b->number);
- b->enable = disabled;
+ b->enable_state = bp_disabled;
}
}
else if ((b->type == bp_hardware_watchpoint ||
b->type == bp_read_watchpoint ||
b->type == bp_access_watchpoint)
- && b->enable == enabled
- && b->disposition != del_at_next_stop
+ && b->enable_state == bp_enabled
+ && b->disposition != disp_del_at_next_stop
&& !b->inserted
&& !b->duplicate)
{
printf_filtered ("because the program has left the block \n");
printf_filtered ("in which its expression is valid.\n");
if (b->related_breakpoint)
- b->related_breakpoint->disposition = del_at_next_stop;
- b->disposition = del_at_next_stop;
+ b->related_breakpoint->disposition = disp_del_at_next_stop;
+ b->disposition = disp_del_at_next_stop;
}
/* Restore the frame and level. */
else if ((b->type == bp_catch_fork
|| b->type == bp_catch_vfork
|| b->type == bp_catch_exec)
- && b->enable == enabled
+ && b->enable_state == bp_enabled
&& !b->inserted
&& !b->duplicate)
{
{
int val;
- if (b->enable == permanent)
+ if (b->enable_state == bp_permanent)
/* Permanent breakpoints cannot be inserted or removed. */
return 0;
else if ((b->type == bp_hardware_watchpoint ||
b->type == bp_read_watchpoint ||
b->type == bp_access_watchpoint)
- && b->enable == enabled
+ && b->enable_state == bp_enabled
&& !b->duplicate)
{
value_ptr v, n;
else if ((b->type == bp_catch_fork ||
b->type == bp_catch_vfork ||
b->type == bp_catch_exec)
- && b->enable == enabled
+ && b->enable_state == bp_enabled
&& !b->duplicate)
{
val = -1;
}
else if ((b->type == bp_catch_catch ||
b->type == bp_catch_throw)
- && b->enable == enabled
+ && b->enable_state == bp_enabled
&& !b->duplicate)
{
}
else if (ep_is_exception_catchpoint (b)
&& b->inserted /* sometimes previous insert doesn't happen */
- && b->enable == enabled
+ && b->enable_state == bp_enabled
&& !b->duplicate)
{
int any_breakpoint_here = 0;
ALL_BREAKPOINTS (b)
- if ((b->enable == enabled
- || b->enable == permanent)
+ if ((b->enable_state == bp_enabled
+ || b->enable_state == bp_permanent)
&& b->address == pc) /* bp is enabled and matches pc */
{
if (overlay_debugging &&
section_is_overlay (b->section) &&
!section_is_mapped (b->section))
continue; /* unmapped overlay -- can't be a match */
- else if (b->enable == permanent)
+ else if (b->enable_state == bp_permanent)
return permanent_breakpoint_here;
else
any_breakpoint_here = 1;
thread = pid_to_thread_id (ptid);
ALL_BREAKPOINTS (b)
- if (b->enable != disabled
- && b->enable != shlib_disabled
- && b->enable != call_disabled
+ if (b->enable_state != bp_disabled
+ && b->enable_state != bp_shlib_disabled
+ && b->enable_state != bp_call_disabled
&& b->address == pc
&& (b->thread == -1 || b->thread == thread))
{
#endif
if (b->related_breakpoint)
- b->related_breakpoint->disposition = del_at_next_stop;
- b->disposition = del_at_next_stop;
+ b->related_breakpoint->disposition = disp_del_at_next_stop;
+ b->disposition = disp_del_at_next_stop;
return WP_DELETED;
}
ALL_BREAKPOINTS_SAFE (b, temp)
{
- if (b->enable == disabled
- || b->enable == shlib_disabled
- || b->enable == call_disabled)
+ if (b->enable_state == bp_disabled
+ || b->enable_state == bp_shlib_disabled
+ || b->enable_state == bp_call_disabled)
continue;
if (b->type != bp_watchpoint
/* Error from catch_errors. */
printf_filtered ("Watchpoint %d deleted.\n", b->number);
if (b->related_breakpoint)
- b->related_breakpoint->disposition = del_at_next_stop;
- b->disposition = del_at_next_stop;
+ b->related_breakpoint->disposition = disp_del_at_next_stop;
+ b->disposition = disp_del_at_next_stop;
/* We've already printed what needs to be printed. */
bs->print_it = print_it_done;
/* Error from catch_errors. */
printf_filtered ("Watchpoint %d deleted.\n", b->number);
if (b->related_breakpoint)
- b->related_breakpoint->disposition = del_at_next_stop;
- b->disposition = del_at_next_stop;
+ b->related_breakpoint->disposition = disp_del_at_next_stop;
+ b->disposition = disp_del_at_next_stop;
/* We've already printed what needs to be printed. */
bs->print_it = print_it_done;
break;
else
{
/* We will stop here */
- if (b->disposition == disable)
- b->enable = disabled;
+ if (b->disposition == disp_disable)
+ b->enable_state = bp_disabled;
bs->commands = b->commands;
if (b->silent)
bs->print = 0;
{
struct breakpoint *b;
ALL_BREAKPOINTS (b)
- if (b->enable == enabled && b->type == bp_watchpoint)
+ if (b->enable_state == bp_enabled && b->type == bp_watchpoint)
return 1;
return 0;
}
{
struct breakpoint *b;
ALL_BREAKPOINTS (b)
- if ((b->enable == enabled) &&
+ if ((b->enable_state == bp_enabled) &&
(b->inserted) &&
((b->type == bp_hardware_watchpoint) ||
(b->type == bp_read_watchpoint) ||
/* 4 */
annotate_field (3);
#ifdef UI_OUT
- ui_out_field_fmt (uiout, "enabled", "%c", bpenables[(int) b->enable]);
+ ui_out_field_fmt (uiout, "enabled", "%c", bpenables[(int) b->enable_state]);
ui_out_spaces (uiout, 2);
#else
- printf_filtered ("%-3c ", bpenables[(int) b->enable]);
+ printf_filtered ("%-3c ", bpenables[(int) b->enable_state]);
#endif
/* 5 and 6 */
others--;
printf_filtered ("%d%s%s ",
b->number,
- ((b->enable == disabled ||
- b->enable == shlib_disabled ||
- b->enable == call_disabled) ? " (disabled)"
- : b->enable == permanent ? " (permanent)"
+ ((b->enable_state == bp_disabled ||
+ b->enable_state == bp_shlib_disabled ||
+ b->enable_state == bp_call_disabled) ? " (disabled)"
+ : b->enable_state == bp_permanent ? " (permanent)"
: ""),
(others > 1) ? ","
: ((others == 1) ? " and" : ""));
return;
ALL_BREAKPOINTS (b)
- if (b->enable != disabled
- && b->enable != shlib_disabled
- && b->enable != call_disabled
+ if (b->enable_state != bp_disabled
+ && b->enable_state != bp_shlib_disabled
+ && b->enable_state != bp_call_disabled
&& b->address == address
&& (overlay_debugging == 0 || b->section == section)
&& breakpoint_address_is_meaningful (b))
{
/* Have we found a permanent breakpoint? */
- if (b->enable == permanent)
+ if (b->enable_state == bp_permanent)
{
perm_bp = b;
break;
"another breakpoint was inserted on top of "
"a permanent breakpoint");
- if (b->enable != disabled
- && b->enable != shlib_disabled
- && b->enable != call_disabled
+ if (b->enable_state != bp_disabled
+ && b->enable_state != bp_shlib_disabled
+ && b->enable_state != bp_call_disabled
&& b->address == address
&& (overlay_debugging == 0 || b->section == section)
&& breakpoint_address_is_meaningful (b))
b->input_radix = input_radix;
b->thread = -1;
b->line_number = sal.line;
- b->enable = enabled;
+ b->enable_state = bp_enabled;
b->next = 0;
b->silent = 0;
b->ignore_count = 0;
void
make_breakpoint_permanent (struct breakpoint *b)
{
- b->enable = permanent;
+ b->enable_state = bp_permanent;
/* By definition, permanent breakpoints are already present in the code. */
b->inserted = 1;
b = set_raw_breakpoint (sal,
func_name != NULL ? bp_longjmp : bp_longjmp_resume);
- b->disposition = donttouch;
- b->enable = disabled;
+ b->disposition = disp_donttouch;
+ b->enable_state = bp_disabled;
b->silent = 1;
if (func_name)
b->addr_string = xstrdup (func_name);
ALL_BREAKPOINTS (b)
if (b->type == bp_longjmp)
{
- b->enable = enabled;
+ b->enable_state = bp_enabled;
check_duplicates (b);
}
}
if (b->type == bp_longjmp
|| b->type == bp_longjmp_resume)
{
- b->enable = disabled;
+ b->enable_state = bp_disabled;
check_duplicates (b);
}
}
b = set_raw_breakpoint (sal, bp_thread_event);
b->number = internal_breakpoint_number--;
- b->disposition = donttouch;
- b->enable = enabled;
+ b->disposition = disp_donttouch;
+ b->enable_state = bp_enabled;
/* addr_string has to be used or breakpoint_re_set will delete me. */
sprintf (addr_string, "*0x%s", paddr (b->address));
b->addr_string = xstrdup (addr_string);
sal.section = find_pc_overlay (sal.pc);
b = set_raw_breakpoint (sal, bp_shlib_event);
b->number = internal_breakpoint_number--;
- b->disposition = donttouch;
+ b->disposition = disp_donttouch;
return b;
}
#if defined (PC_SOLIB)
if (((b->type == bp_breakpoint) ||
(b->type == bp_hardware_breakpoint)) &&
- b->enable == enabled &&
+ b->enable_state == bp_enabled &&
!b->duplicate &&
PC_SOLIB (b->address))
{
- b->enable = shlib_disabled;
+ b->enable_state = bp_shlib_disabled;
if (!silent)
{
if (!disabled_shlib_breaks)
struct breakpoint *b;
ALL_BREAKPOINTS (b)
- if (b->enable == shlib_disabled)
+ if (b->enable_state == bp_shlib_disabled)
{
char buf[1];
/* Do not reenable the breakpoint if the shared library
is still not mapped in. */
if (target_read_memory (b->address, buf, 1) == 0)
- b->enable = enabled;
+ b->enable_state = bp_enabled;
}
}
else if (addr_start)
b->addr_string = savestring (addr_start, addr_end - addr_start);
- b->enable = enabled;
- b->disposition = tempflag ? del : donttouch;
+ b->enable_state = bp_enabled;
+ b->disposition = tempflag ? disp_del : disp_donttouch;
if (dll_pathname == NULL)
b->dll_pathname = NULL;
NULL : savestring (cond_string, strlen (cond_string));
b->thread = thread;
b->addr_string = NULL;
- b->enable = enabled;
- b->disposition = tempflag ? del : donttouch;
+ b->enable_state = bp_enabled;
+ b->disposition = tempflag ? disp_del : disp_donttouch;
b->forked_inferior_pid = 0;
mention (b);
NULL : savestring (cond_string, strlen (cond_string));
b->thread = thread;
b->addr_string = NULL;
- b->enable = enabled;
- b->disposition = tempflag ? del : donttouch;
+ b->enable_state = bp_enabled;
+ b->disposition = tempflag ? disp_del : disp_donttouch;
mention (b);
}
ALL_BREAKPOINTS (b)
{
- if (b->type == bp_hardware_breakpoint && b->enable == enabled)
+ if (b->type == bp_hardware_breakpoint && b->enable_state == bp_enabled)
i++;
}
*other_type_used = 0;
ALL_BREAKPOINTS (b)
{
- if (b->enable == enabled)
+ if (b->enable_state == bp_enabled)
{
if (b->type == type)
i++;
else if ((b->type == bp_hardware_watchpoint ||
b->type == bp_read_watchpoint ||
b->type == bp_access_watchpoint)
- && b->enable == enabled)
+ && b->enable_state == bp_enabled)
*other_type_used = 1;
}
}
if (b->type == bp_longjmp_resume)
{
b->address = pc;
- b->enable = enabled;
+ b->enable_state = bp_enabled;
if (frame != NULL)
b->frame = frame->frame;
else
|| (b->type == bp_read_watchpoint)
|| (b->type == bp_access_watchpoint)
|| ep_is_exception_catchpoint (b))
- && (b->enable == enabled))
+ && (b->enable_state == bp_enabled))
{
- b->enable = call_disabled;
+ b->enable_state = bp_call_disabled;
check_duplicates (b);
}
}
|| (b->type == bp_read_watchpoint)
|| (b->type == bp_access_watchpoint)
|| ep_is_exception_catchpoint (b))
- && (b->enable == call_disabled))
+ && (b->enable_state == bp_call_disabled))
{
- b->enable = enabled;
+ b->enable_state = bp_enabled;
check_duplicates (b);
}
}
{
register struct breakpoint *b;
b = set_raw_breakpoint (sal, type);
- b->enable = enabled;
- b->disposition = donttouch;
+ b->enable_state = bp_enabled;
+ b->disposition = disp_donttouch;
b->frame = (frame ? frame->frame : 0);
/* If we're debugging a multi-threaded program, then we
b->addr_string = addr_string[i];
b->cond_string = cond_string[i];
b->ignore_count = ignore_count;
- b->enable = enabled;
+ b->enable_state = bp_enabled;
b->disposition = disposition;
mention (b);
}
create_breakpoints (sals, addr_string, cond, cond_string,
hardwareflag ? bp_hardware_breakpoint : bp_breakpoint,
- tempflag ? del : donttouch,
+ tempflag ? disp_del : disp_donttouch,
thread, ignore_count, from_tty);
if (sals.nelts > 1)
create_breakpoints (sals, addr_string, cond, cond_string,
args->hardwareflag ? bp_hardware_breakpoint : bp_breakpoint,
- args->tempflag ? del : donttouch,
+ args->tempflag ? disp_del : disp_donttouch,
args->thread, args->ignore_count, 0/*from-tty*/);
/* That's it. Discard the cleanups for data inserted into the
b = set_raw_breakpoint (sal, bp_type);
set_breakpoint_count (breakpoint_count + 1);
b->number = breakpoint_count;
- b->disposition = donttouch;
+ b->disposition = disp_donttouch;
b->exp = exp;
b->exp_valid_block = exp_valid_block;
b->exp_string = savestring (exp_start, exp_end - exp_start);
set_breakpoint_count (breakpoint_count + 1);
scope_breakpoint->number = breakpoint_count;
- scope_breakpoint->enable = enabled;
+ scope_breakpoint->enable_state = bp_enabled;
/* Automatically delete the breakpoint when it hits. */
- scope_breakpoint->disposition = del;
+ scope_breakpoint->disposition = disp_del;
/* Only break in the proper frame (help with recursion). */
scope_breakpoint->frame = prev_frame->frame;
NULL : savestring (cond_string, strlen (cond_string));
b->thread = thread;
b->addr_string = NULL;
- b->enable = enabled;
- b->disposition = tempflag ? del : donttouch;
+ b->enable_state = bp_enabled;
+ b->disposition = tempflag ? disp_del : disp_donttouch;
mention (b);
}
{
args_for_catchpoint_enable *args = arg;
struct symtab_and_line *sal;
- sal = target_enable_exception_callback (args->kind, args->enable);
+ sal = target_enable_exception_callback (args->kind, args->enable_p);
if (sal == NULL)
return 0;
else if (sal == (struct symtab_and_line *) -1)
b->number = breakpoint_count;
b->cond = cond;
- b->enable = enabled;
- b->disposition = tempflag ? del : donttouch;
+ b->enable_state = bp_enabled;
+ b->disposition = tempflag ? disp_del : disp_donttouch;
mention (b);
}
b = set_raw_breakpoint (sal, bp_breakpoint);
- b->disposition = del;
- b->enable = enabled;
+ b->disposition = disp_del;
+ b->enable_state = bp_enabled;
b->silent = 1;
b->number = internal_breakpoint_number--;
return b;
struct breakpoint *b, *temp;
for (; bs; bs = bs->next)
- if (bs->breakpoint_at && bs->breakpoint_at->disposition == del
+ if (bs->breakpoint_at && bs->breakpoint_at->disposition == disp_del
&& bs->stop)
delete_breakpoint (bs->breakpoint_at);
ALL_BREAKPOINTS_SAFE (b, temp)
{
- if (b->disposition == del_at_next_stop)
+ if (b->disposition == disp_del_at_next_stop)
delete_breakpoint (b);
}
}
sprintf (message, message1, bpt->number);
args.kind = bpt->type == bp_catch_catch ?
EX_EVENT_CATCH : EX_EVENT_THROW;
- args.enable = 0;
+ args.enable_p = 0;
catch_errors (cover_target_enable_exception_callback, &args,
message, RETURN_MASK_ALL);
}
if (b->address == bpt->address
&& b->section == bpt->section
&& !b->duplicate
- && b->enable != disabled
- && b->enable != shlib_disabled
- && b->enable != call_disabled)
+ && b->enable_state != bp_disabled
+ && b->enable_state != bp_shlib_disabled
+ && b->enable_state != bp_call_disabled)
{
int val;
breakpoint at the same address as the one being deleted.
If there is a permanent breakpoint somewhere, it should
always be the only one inserted. */
- if (b->enable == permanent)
+ if (b->enable_state == bp_permanent)
internal_error (__FILE__, __LINE__,
"another breakpoint was inserted on top of "
"a permanent breakpoint");
int i;
struct symtabs_and_lines sals;
char *s;
- enum enable save_enable;
+ enum enable_state save_enable;
switch (b->type)
{
}
/* In case we have a problem, disable this breakpoint. We'll restore
its status if we succeed. */
- save_enable = b->enable;
- b->enable = disabled;
+ save_enable = b->enable_state;
+ b->enable_state = bp_disabled;
set_language (b->language);
input_radix = b->input_radix;
breakpoints_changed ();
}
b->section = sals.sals[i].section;
- b->enable = save_enable; /* Restore it, this worked. */
+ b->enable_state = save_enable; /* Restore it, this worked. */
/* Now that this is re-enabled, check_duplicates
xfree (b->cond);
b->cond = parse_exp_1 (&s, (struct block *) 0, 0);
}
- if (b->enable == enabled)
+ if (b->enable_state == bp_enabled)
mention (b);
value_free_to_mark (mark);
break;
return;
/* You can't disable permanent breakpoints. */
- if (bpt->enable == permanent)
+ if (bpt->enable_state == bp_permanent)
return;
- bpt->enable = disabled;
+ bpt->enable_state = bp_disabled;
check_duplicates (bpt);
error ("Hardware breakpoints used exceeds limit.");
}
- if (bpt->enable != permanent)
- bpt->enable = enabled;
+ if (bpt->enable_state != bp_permanent)
+ bpt->enable_state = bp_enabled;
bpt->disposition = disposition;
check_duplicates (bpt);
breakpoints_changed ();
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 = disabled;
+ bpt->enable_state = bp_disabled;
return;
}
printf_filtered ("\
Cannot enable watchpoint %d because target watch resources\n\
have been allocated for other watchpoints.\n", bpt->number);
- bpt->enable = disabled;
+ bpt->enable_state = bp_disabled;
value_free_to_mark (mark);
return;
}
static void
enable_once_breakpoint (struct breakpoint *bpt)
{
- do_enable_breakpoint (bpt, disable);
+ do_enable_breakpoint (bpt, disp_disable);
}
/* ARGSUSED */
static void
enable_delete_breakpoint (struct breakpoint *bpt)
{
- do_enable_breakpoint (bpt, del);
+ do_enable_breakpoint (bpt, disp_del);
}
/* ARGSUSED */