char *cond_string,
enum bptype type, enum bpdisp disposition,
int thread, int ignore_count,
- struct breakpoint_ops *ops, int from_tty)
+ struct breakpoint_ops *ops, int from_tty, int enabled)
{
struct breakpoint *b = NULL;
int i;
b->cond_string = cond_string;
b->ignore_count = ignore_count;
- b->enable_state = bp_enabled;
+ b->enable_state = enabled ? bp_enabled : bp_disabled;
b->disposition = disposition;
loc = b->loc;
char *cond_string,
enum bptype type, enum bpdisp disposition,
int thread, int ignore_count,
- struct breakpoint_ops *ops, int from_tty)
+ struct breakpoint_ops *ops, int from_tty,
+ int enabled)
{
int i;
for (i = 0; i < sals.nelts; ++i)
create_breakpoint (expanded, addr_string[i],
cond_string, type, disposition,
- thread, ignore_count, ops, from_tty);
+ thread, ignore_count, ops, from_tty, enabled);
}
update_global_location_list (1);
int ignore_count,
enum auto_boolean pending_break_support,
struct breakpoint_ops *ops,
- int from_tty)
+ int from_tty,
+ int enabled)
{
struct gdb_exception e;
struct symtabs_and_lines sals;
hardwareflag ? bp_hardware_breakpoint
: bp_breakpoint,
tempflag ? disp_del : disp_donttouch,
- thread, ignore_count, ops, from_tty);
+ thread, ignore_count, ops, from_tty, enabled);
}
else
{
b->disposition = tempflag ? disp_del : disp_donttouch;
b->condition_not_parsed = 1;
b->ops = ops;
+ b->enable_state = enabled ? bp_enabled : bp_disabled;
update_global_location_list (1);
mention (b);
0 /* Ignore count */,
pending_break_support,
NULL /* breakpoint_ops */,
- from_tty);
+ from_tty,
+ 1 /* enabled */);
}
set_breakpoint (char *address, char *condition,
int hardwareflag, int tempflag,
int thread, int ignore_count,
- int pending)
+ int pending, int enabled)
{
break_command_really (address, condition, thread,
0 /* condition and thread are valid. */,
ignore_count,
pending
? AUTO_BOOLEAN_TRUE : AUTO_BOOLEAN_FALSE,
- NULL, 0);
+ NULL, 0, enabled);
}
/* Adjust SAL to the first instruction past the function prologue.
tempflag, 0,
0,
AUTO_BOOLEAN_TRUE /* pending */,
- &gnu_v3_exception_catchpoint_ops, from_tty);
+ &gnu_v3_exception_catchpoint_ops, from_tty,
+ 1 /* enabled */);
return 1;
}
int ignore_count = 0;
char *condition = NULL;
int pending = 0;
+ int enabled = 1;
+
struct gdb_exception e;
struct gdb_events *old_hooks;
enum opt
{
HARDWARE_OPT, TEMP_OPT /*, REGEXP_OPT */ , CONDITION_OPT,
- IGNORE_COUNT_OPT, THREAD_OPT, PENDING_OPT
+ IGNORE_COUNT_OPT, THREAD_OPT, PENDING_OPT, DISABLE_OPT
};
static struct mi_opt opts[] =
{
{"i", IGNORE_COUNT_OPT, 1},
{"p", THREAD_OPT, 1},
{"f", PENDING_OPT, 0},
+ {"d", DISABLE_OPT, 0},
{ 0, 0, 0 }
};
case PENDING_OPT:
pending = 1;
break;
+ case DISABLE_OPT:
+ enabled = 0;
}
}
set_breakpoint (address, condition,
0 /*hardwareflag */ , temp_p,
thread, ignore_count,
- pending);
+ pending, enabled);
break;
case HW_BP:
set_breakpoint (address, condition,
1 /*hardwareflag */ , temp_p,
thread, ignore_count,
- pending);
+ pending, enabled);
break;
#if 0
case REGEXP_BP:
"update varobj for function call"
}
+proc test_disabled_creation {} {
+ global mi_gdb_prompt
+ global hex
+ global line_callee2_body
+
+ mi_gdb_test "-break-insert -d basics.c:callee2" \
+ "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\",line=\"$line_callee2_body\",times=\"0\",original-location=\".*\"\}" \
+ "test disabled creation"
+
+ mi_gdb_test "-break-delete" \
+ "\\^done" \
+ "test disabled creation: cleanup"
+}
+
test_tbreak_creation_and_listing
test_rbreak_creation_and_listing
test_error
+test_disabled_creation
+
mi_gdb_exit
return 0