* breakpoint.c (create_breakpoint, create_breakpoints)

(break_command_really, set_breakpoint): New parameter enabled.
	(create_breakpoint, break_command_really): Make breakpoint
	disabled if so requested.
	* breakpoint.h (set_breakpoint): New parameter enabled.
	* mi/mi-cmd-break.c (mi_cmd_break_insert): Handle the -d option.
This commit is contained in:
Vladimir Prus 2009-01-30 18:28:01 +00:00
parent 33a7ffc270
commit 41447f92e2
8 changed files with 63 additions and 15 deletions

View File

@ -1,3 +1,12 @@
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
* breakpoint.c (create_breakpoint, create_breakpoints)
(break_command_really, set_breakpoint): New parameter enabled.
(create_breakpoint, break_command_really): Make breakpoint
disabled if so requested.
* breakpoint.h (set_breakpoint): New parameter enabled.
* mi/mi-cmd-break.c (mi_cmd_break_insert): Handle the -d option.
2009-01-28 Doug Evans <dje@google.com>
* amd64-tdep.h (amd64_displaced_step_copy_insn): Declare.

View File

@ -5090,7 +5090,7 @@ create_breakpoint (struct symtabs_and_lines sals, char *addr_string,
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;
@ -5124,7 +5124,7 @@ create_breakpoint (struct symtabs_and_lines sals, char *addr_string,
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;
@ -5299,7 +5299,8 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string,
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)
@ -5309,7 +5310,7 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string,
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);
@ -5481,7 +5482,8 @@ break_command_really (char *arg, char *cond_string, int thread,
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;
@ -5614,7 +5616,7 @@ break_command_really (char *arg, char *cond_string, int thread,
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
{
@ -5635,6 +5637,7 @@ break_command_really (char *arg, char *cond_string, int thread,
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);
@ -5669,7 +5672,8 @@ break_command_1 (char *arg, int flag, int from_tty)
0 /* Ignore count */,
pending_break_support,
NULL /* breakpoint_ops */,
from_tty);
from_tty,
1 /* enabled */);
}
@ -5677,7 +5681,7 @@ void
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. */,
@ -5685,7 +5689,7 @@ set_breakpoint (char *address, char *condition,
ignore_count,
pending
? AUTO_BOOLEAN_TRUE : AUTO_BOOLEAN_FALSE,
NULL, 0);
NULL, 0, enabled);
}
/* Adjust SAL to the first instruction past the function prologue.
@ -6536,7 +6540,8 @@ handle_gnu_v3_exceptions (int tempflag, char *cond_string,
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;
}

View File

@ -705,7 +705,8 @@ extern void tbreak_command (char *, int);
extern void set_breakpoint (char *address, char *condition,
int hardwareflag, int tempflag,
int thread, int ignore_count,
int pending);
int pending,
int enabled);
extern void insert_breakpoints (void);

View File

@ -1,3 +1,8 @@
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
* gdb.texinfo (GDB/MI Breakpoint Commands): Document the -d
option to -break-insert.
2009-01-28 Daniel Jacobowitz <dan@codesourcery.com>
Jerome Guitton <guitton@adacore.com>

View File

@ -19925,7 +19925,7 @@ N.A.
@subsubheading Synopsis
@smallexample
-break-insert [ -t ] [ -h ] [ -f ]
-break-insert [ -t ] [ -h ] [ -f ] [ -d ]
[ -c @var{condition} ] [ -i @var{ignore-count} ]
[ -p @var{thread} ] [ @var{location} ]
@end smallexample
@ -19960,6 +19960,8 @@ refers to unknown files or functions), create a pending
breakpoint. Without this flag, @value{GDBN} will report
an error, and won't create a breakpoint, if @var{location}
cannot be parsed.
@item -d
Create a disabled breakpoint.
@end table
@subsubheading Result

View File

@ -71,12 +71,14 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
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[] =
{
@ -86,6 +88,7 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
{"i", IGNORE_COUNT_OPT, 1},
{"p", THREAD_OPT, 1},
{"f", PENDING_OPT, 0},
{"d", DISABLE_OPT, 0},
{ 0, 0, 0 }
};
@ -123,6 +126,8 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
case PENDING_OPT:
pending = 1;
break;
case DISABLE_OPT:
enabled = 0;
}
}
@ -151,13 +156,13 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
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:

View File

@ -1,3 +1,8 @@
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
* gdb.mi/mi-break.exp (test_disabled_creation): New.
Call it.
2009-01-28 Doug Evans <dje@google.com>
* gdb.arch/amd64-disp-step.S: New file.

View File

@ -183,6 +183,20 @@ proc test_error {} {
"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
@ -190,5 +204,7 @@ test_ignore_count
test_error
test_disabled_creation
mi_gdb_exit
return 0