/* NOTE: the following values are a part of MI protocol and represent
values of 'disp' field returned when inferior stops at a breakpoint. */
static char *bpdisps[] = {"del", "dstp", "dis", "keep"};
+
return bpdisps[(int) disp];
}
{
struct counted_command_line *result
= xmalloc (sizeof (struct counted_command_line));
+
result->refc = 1;
result->commands = commands;
return result;
else
{
char *arg = exp;
+
/* I don't know if it matters whether this is the string the user
typed in or the decompiled expression. */
b->cond_string = xstrdup (arg);
check_no_tracepoint_commands (struct command_line *commands)
{
struct command_line *c;
+
for (c = commands; c; c = c->next)
{
int i;
check_tracepoint_command (char *line, void *closure)
{
struct breakpoint *b = closure;
+
validate_actionline (&line, b);
}
if (new_type != bpt->loc_type)
{
static int said = 0;
+
bpt->loc_type = new_type;
if (!said)
{
{
struct value *mark = value_mark ();
int i = !value_true (evaluate_expression ((struct expression *) exp));
+
value_free_to_mark (mark);
return i;
}
bpstat_should_step (void)
{
struct breakpoint *b;
+
ALL_BREAKPOINTS (b)
if (breakpoint_enabled (b) && b->type == bp_watchpoint && b->loc != NULL)
return 1;
struct captured_breakpoint_query_args *args = data;
struct breakpoint *b;
struct bp_location *dummy_loc = NULL;
+
ALL_BREAKPOINTS (b)
{
if (args->bnum == b->number)
{
int print_address_bits = breakpoint_address_bits (b);
+
print_one_breakpoint (b, &dummy_loc, print_address_bits, 0);
return GDB_RC_OK;
}
gdb_breakpoint_query (struct ui_out *uiout, int bnum, char **error_message)
{
struct captured_breakpoint_query_args args;
+
args.bnum = bnum;
/* For the moment we don't trust print_one_breakpoint() to not throw
an error. */
CORE_ADDR pc, struct obj_section *section)
{
struct bp_location *bl = b->loc;
+
for (; bl; bl = bl->next)
{
if (bl->pspace == pspace
make_breakpoint_permanent (struct breakpoint *b)
{
struct bp_location *bl;
+
b->enable_state = bp_permanent;
/* By definition, permanent breakpoints are already present in the code.
&& b->type == bp_longjmp_master)
{
struct breakpoint *clone = clone_momentary_breakpoint (b);
+
clone->type = bp_longjmp;
clone->thread = thread;
}
ALL_BP_LOCATIONS (loc, locp_tmp)
{
struct breakpoint *b = loc->owner;
+
if ((loc->loc_type == bp_loc_hardware_breakpoint
|| loc->loc_type == bp_loc_software_breakpoint)
&& solib->pspace == loc->pspace
else
{
int i, iter;
+
for (i = 0;
VEC_iterate (int, b->syscalls_to_be_caught, i, iter);
i++)
{
int elem;
+
if (iter >= VEC_length (int, inf->syscalls_counts))
{
int old_size = VEC_length (int, inf->syscalls_counts);
else
{
int i, iter;
+
for (i = 0;
VEC_iterate (int, b->syscalls_to_be_caught, i, iter);
i++)
if (b->syscalls_to_be_caught)
{
int i, iter;
+
for (i = 0;
VEC_iterate (int, b->syscalls_to_be_caught, i, iter);
i++)
{
int i, iter;
char *text = xstrprintf ("%s", "");
+
for (i = 0;
VEC_iterate (int, b->syscalls_to_be_caught, i, iter);
i++)
int enabled)
{
int i;
+
for (i = 0; i < sals.nelts; ++i)
{
struct symtabs_and_lines expanded =
int *not_found_ptr)
{
char *addr_start = *address;
+
*addr_string = NULL;
/* If no arg given, or if first arg is 'if ', use the default
breakpoint. */
if (default_breakpoint_valid)
{
struct symtab_and_line sal;
+
init_sal (&sal); /* initialize to zeroes */
sals->sals = (struct symtab_and_line *)
xmalloc (sizeof (struct symtab_and_line));
if (addr_start != (*address))
{
int i;
+
for (i = 0; i < sals->nelts; i++)
{
/* Add the string if not present. */
if ((*addr_string)[i] == NULL)
- (*addr_string)[i] = savestring (addr_start, (*address) - addr_start);
+ (*addr_string)[i] = savestring (addr_start,
+ (*address) - addr_start);
}
}
}
char *address)
{
int i;
+
for (i = 0; i < sals->nelts; i++)
resolve_sal_pc (&sals->sals[i]);
}
int toklen;
char *cond_start = NULL;
char *cond_end = NULL;
+
while (*tok == ' ' || *tok == '\t')
tok++;
}
-
/* Helper function for break_command_1 and disassemble_command. */
void
catch_fork_kind;
static void
-catch_fork_command_1 (char *arg, int from_tty, struct cmd_list_element *command)
+catch_fork_command_1 (char *arg, int from_tty,
+ struct cmd_list_element *command)
{
struct gdbarch *gdbarch = get_current_arch ();
char *cond_string = NULL;
}
static void
-catch_exec_command_1 (char *arg, int from_tty, struct cmd_list_element *command)
+catch_exec_command_1 (char *arg, int from_tty,
+ struct cmd_list_element *command)
{
struct gdbarch *gdbarch = get_current_arch ();
int tempflag;
}
static void
-print_one_exception_catchpoint (struct breakpoint *b, struct bp_location **last_loc)
+print_one_exception_catchpoint (struct breakpoint *b,
+ struct bp_location **last_loc)
{
struct value_print_options opts;
+
get_user_print_options (&opts);
if (opts.addressprint)
{
catch_catch_command (char *arg, int from_tty, struct cmd_list_element *command)
{
int tempflag = get_cmd_context (command) == CATCH_TEMPORARY;
+
catch_exception_command_1 (EX_EVENT_CATCH, arg, tempflag, from_tty);
}
catch_throw_command (char *arg, int from_tty, struct cmd_list_element *command)
{
int tempflag = get_cmd_context (command) == CATCH_TEMPORARY;
+
catch_exception_command_1 (EX_EVENT_THROW, arg, tempflag, from_tty);
}
/* Implement the "catch syscall" command. */
static void
-catch_syscall_command_1 (char *arg, int from_tty, struct cmd_list_element *command)
+catch_syscall_command_1 (char *arg, int from_tty,
+ struct cmd_list_element *command)
{
int tempflag;
VEC(int) *filter;
update_global_location_list_nothrow (int inserting)
{
struct gdb_exception e;
+
TRY_CATCH (e, RETURN_MASK_ERROR)
update_global_location_list (inserting);
}
bpstat_remove_breakpoint (bpstat bps, struct breakpoint *bpt)
{
bpstat bs;
+
for (bs = bps; bs; bs = bs->next)
if (bs->breakpoint_at && bs->breakpoint_at->owner == bpt)
{
bpstat_remove_breakpoint_callback (struct thread_info *th, void *data)
{
struct breakpoint *bpt = data;
+
bpstat_remove_breakpoint (th->stop_bpstat, bpt);
return 0;
}
{
struct bp_location *l;
htab_t htab = htab_create_alloc (13, htab_hash_string,
- (int (*) (const void *, const void *)) streq,
+ (int (*) (const void *,
+ const void *)) streq,
NULL, xcalloc, xfree);
for (l = loc; l != NULL; l = l->next)
disable_command (char *args, int from_tty)
{
struct breakpoint *bpt;
+
if (args == 0)
ALL_BREAKPOINTS (bpt)
switch (bpt->type)
enable_command (char *args, int from_tty)
{
struct breakpoint *bpt;
+
if (args == 0)
ALL_BREAKPOINTS (bpt)
switch (bpt->type)
decode_line_spec_1 (char *string, int funfirstline)
{
struct symtabs_and_lines sals;
+
if (string == 0)
error (_("Empty line specification."));
if (default_breakpoint_valid)
/* Check whether a software single-step breakpoint is inserted at PC. */
static int
-single_step_breakpoint_inserted_here_p (struct address_space *aspace, CORE_ADDR pc)
+single_step_breakpoint_inserted_here_p (struct address_space *aspace,
+ CORE_ADDR pc)
{
int i;
char *text, char *word)
{
const char **list = get_syscall_names ();
+
return (list == NULL) ? NULL : complete_on_enum (list, text, word);
}