ALL_BREAKPOINTS (b)
if (b->number == bnum)
{
- if (b->cond)
+ struct bp_location *loc = b->loc;
+ if (loc->cond)
{
- xfree (b->cond);
- b->cond = 0;
+ xfree (loc->cond);
+ loc->cond = 0;
}
if (b->cond_string != NULL)
xfree (b->cond_string);
if (*p == 0)
{
- b->cond = 0;
b->cond_string = NULL;
if (from_tty)
printf_filtered (_("Breakpoint %d now unconditional.\n"), bnum);
b->cond_string = savestring (arg, strlen (arg));
if (!b->pending)
{
- b->cond = parse_exp_1 (&arg, block_for_pc (b->loc->address), 0);
+ b->loc->cond = parse_exp_1 (&arg,
+ block_for_pc (b->loc->address), 0);
if (*arg)
error (_("Junk at end of expression"));
}
{
int value_is_zero = 0;
- if (b->cond)
+ if (b->loc->cond)
{
/* Need to select the frame, with all that implies
so that the conditions will have the right context. */
select_frame (get_current_frame ());
value_is_zero
- = catch_errors (breakpoint_cond_eval, (b->cond),
+ = catch_errors (breakpoint_cond_eval, (b->loc->cond),
"Error in testing breakpoint condition:\n",
RETURN_MASK_ALL);
/* FIXME-someday, should give breakpoint # */
free_all_values ();
}
- if (b->cond && value_is_zero)
+ if (b->loc->cond && value_is_zero)
{
bs->stop = 0;
/* Don't consider this a hit. */
ui_out_text (uiout, "\n");
}
- if (b->cond && !ada_exception_catchpoint_p (b))
+ if (b->loc->cond && !ada_exception_catchpoint_p (b))
{
/* We do not print the condition for Ada exception catchpoints
because the condition is an internal implementation detail
that we do not want to expose to the user. */
annotate_field (7);
ui_out_text (uiout, "\tstop only if ");
- print_expression (b->cond, stb->stream);
+ print_expression (b->loc->cond, stb->stream);
ui_out_field_stream (uiout, "cond", stb);
ui_out_text (uiout, "\n");
}
memset (loc, 0, sizeof (*loc));
loc->owner = bpt;
+ loc->cond = NULL;
switch (bp_type)
{
b = set_raw_breakpoint (sals.sals[0], bp_kind);
set_breakpoint_count (breakpoint_count + 1);
b->number = breakpoint_count;
- b->cond = NULL;
b->cond_string = (cond_string == NULL) ?
NULL : savestring (cond_string, strlen (cond_string));
b->thread = thread;
b = set_raw_breakpoint (sal, bp_kind);
set_breakpoint_count (breakpoint_count + 1);
b->number = breakpoint_count;
- b->cond = NULL;
b->cond_string = (cond_string == NULL) ?
NULL : savestring (cond_string, strlen (cond_string));
b->thread = thread;
b = set_raw_breakpoint (sal, bp_catch_exec);
set_breakpoint_count (breakpoint_count + 1);
b->number = breakpoint_count;
- b->cond = NULL;
b->cond_string = (cond_string == NULL) ?
NULL : savestring (cond_string, strlen (cond_string));
b->thread = thread;
b = set_raw_breakpoint (sal, type);
set_breakpoint_count (breakpoint_count + 1);
b->number = breakpoint_count;
- b->cond = cond[i];
+ b->loc->cond = cond[i];
b->thread = thread;
if (addr_string[i])
b->addr_string = addr_string[i];
{
arg = pending_bp->cond_string;
b->cond_string = savestring (arg, strlen (arg));
- b->cond = parse_exp_1 (&arg, block_for_pc (b->loc->address), 0);
+ b->loc->cond = parse_exp_1 (&arg, block_for_pc (b->loc->address), 0);
if (*arg)
error (_("Junk at end of pending breakpoint condition expression"));
}
: bp_breakpoint);
set_breakpoint_count (breakpoint_count + 1);
b->number = breakpoint_count;
- b->cond = *cond;
+ b->loc->cond = *cond;
b->thread = thread;
b->addr_string = *addr_string;
b->cond_string = *cond_string;
b->exp_valid_block = exp_valid_block;
b->exp_string = savestring (exp_start, exp_end - exp_start);
b->val = val;
- b->cond = cond;
+ b->loc->cond = cond;
if (cond_start)
b->cond_string = savestring (cond_start, cond_end - cond_start);
else
b = set_raw_breakpoint (*sal, bptype);
set_breakpoint_count (breakpoint_count + 1);
b->number = breakpoint_count;
- b->cond = NULL;
b->cond_string = (cond_string == NULL) ?
NULL : savestring (cond_string, strlen (cond_string));
b->thread = thread;
b = set_raw_breakpoint (sals.sals[0], bp_breakpoint);
set_breakpoint_count (breakpoint_count + 1);
b->number = breakpoint_count;
- b->cond = NULL;
b->cond_string = (cond_string == NULL) ?
NULL : savestring (cond_string, strlen (cond_string));
b->thread = -1;
b->disposition = tempflag ? disp_del : disp_donttouch;
b->number = breakpoint_count;
b->ignore_count = 0;
- b->cond = cond;
+ b->loc->cond = cond;
b->addr_string = addr_string;
b->language = language_ada;
b->cond_string = cond_string;
b = set_raw_breakpoint (sal, bp_breakpoint);
set_breakpoint_count (breakpoint_count + 1);
b->number = breakpoint_count;
- b->cond = 0;
b->thread = -1;
return b;
}
}
free_command_lines (&bpt->commands);
- if (bpt->cond)
- xfree (bpt->cond);
if (bpt->cond_string != NULL)
xfree (bpt->cond_string);
if (bpt->addr_string != NULL)
bp, we mark it as deleted before freeing its storage. */
bpt->type = bp_none;
+ if (bpt->loc->cond)
+ xfree (bpt->loc->cond);
xfree (bpt->loc);
xfree (bpt);
}
if (b->cond_string != NULL)
{
s = b->cond_string;
- if (b->cond)
+ if (b->loc->cond)
{
- xfree (b->cond);
+ xfree (b->loc->cond);
/* Avoid re-freeing b->exp if an error during the call
to parse_exp_1. */
- b->cond = NULL;
+ b->loc->cond = NULL;
}
- b->cond = parse_exp_1 (&s, block_for_pc (sals.sals[i].pc), 0);
+ b->loc->cond = parse_exp_1 (&s, block_for_pc (sals.sals[i].pc), 0);
}
/* We need to re-set the breakpoint if the address changes... */
if (b->cond_string != NULL)
{
s = b->cond_string;
- if (b->cond)
+ if (b->loc->cond)
{
- xfree (b->cond);
+ xfree (b->loc->cond);
/* Avoid re-freeing b->exp if an error during the call
to parse_exp_1. */
- b->cond = NULL;
+ b->loc->cond = NULL;
}
- b->cond = parse_exp_1 (&s, (struct block *) 0, 0);
+ b->loc->cond = parse_exp_1 (&s, (struct block *) 0, 0);
}
if (breakpoint_enabled (b))
mention (b);