aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2012-03-13 13:30:42 +0000
committerPedro Alves <palves@redhat.com>2012-03-13 13:30:42 +0000
commit44f238bb633edb3694f64cb6d3b60c510b2fb714 (patch)
tree2ee05ab5b352806836dcec688cbe1eb51a0317ab /gdb/breakpoint.c
parent1e51243a97c3b50ae80b54b4d3d54720e36ba0dc (diff)
downloadgdb-44f238bb633edb3694f64cb6d3b60c510b2fb714.zip
gdb-44f238bb633edb3694f64cb6d3b60c510b2fb714.tar.gz
gdb-44f238bb633edb3694f64cb6d3b60c510b2fb714.tar.bz2
2012-03-13 Hui Zhu <teawater@gmail.com>
Pedro Alves <palves@redhat.com> * breakpoint.c (init_breakpoint_sal): New flags parameter. Handle CREATE_BREAKPOINT_FLAGS_INSERTED. (create_breakpoint_sal, create_breakpoints_sal) (base_breakpoint_create_breakpoints_sal) (tracepoint_create_breakpoints_sal) (strace_marker_create_breakpoints_sal): New flags parameter. Pass down. (break_command_1, handle_gnu_v3_exceptions, trace_command) (ftrace_command, strace_command): Adjust. (create_tracepoint_from_upload): Pass CREATE_BREAKPOINT_FLAGS_INSERTED. * breakpoint.h (enum breakpoint_create_flags): New. (create_breakpoint): New flags parameter. * mi/mi-cmd-break.c (mi_cmd_break_insert): Adjust. * python/py-breakpoint.c (bppy_init): Adjust. * python/py-finishbreakpoint.c (bpfinishpy_init): Adjust. * spu-tdep.c (spu_catch_start): Adjust.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c58
1 files changed, 35 insertions, 23 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index baccfb3..d35704d 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -112,7 +112,7 @@ static void create_breakpoints_sal_default (struct gdbarch *,
enum bpdisp, int, int,
int,
const struct breakpoint_ops *,
- int, int, int);
+ int, int, int, unsigned);
static void decode_linespec_default (struct breakpoint *, char **,
struct symtabs_and_lines *);
@@ -8274,7 +8274,8 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
enum bptype type, enum bpdisp disposition,
int thread, int task, int ignore_count,
const struct breakpoint_ops *ops, int from_tty,
- int enabled, int internal, int display_canonical)
+ int enabled, int internal, unsigned flags,
+ int display_canonical)
{
int i;
@@ -8320,6 +8321,9 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
b->enable_state = enabled ? bp_enabled : bp_disabled;
b->disposition = disposition;
+ if ((flags & CREATE_BREAKPOINT_FLAGS_INSERTED) != 0)
+ b->loc->inserted = 1;
+
if (type == bp_static_tracepoint)
{
struct tracepoint *t = (struct tracepoint *) b;
@@ -8363,6 +8367,8 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
else
{
loc = add_location_to_breakpoint (b, &sal);
+ if ((flags & CREATE_BREAKPOINT_FLAGS_INSERTED) != 0)
+ loc->inserted = 1;
}
if (bp_loc_is_permanent (loc))
@@ -8395,7 +8401,8 @@ create_breakpoint_sal (struct gdbarch *gdbarch,
enum bptype type, enum bpdisp disposition,
int thread, int task, int ignore_count,
const struct breakpoint_ops *ops, int from_tty,
- int enabled, int internal, int display_canonical)
+ int enabled, int internal, unsigned flags,
+ int display_canonical)
{
struct breakpoint *b;
struct cleanup *old_chain;
@@ -8418,7 +8425,8 @@ create_breakpoint_sal (struct gdbarch *gdbarch,
type, disposition,
thread, task, ignore_count,
ops, from_tty,
- enabled, internal, display_canonical);
+ enabled, internal, flags,
+ display_canonical);
discard_cleanups (old_chain);
install_breakpoint (internal, b, 0);
@@ -8446,7 +8454,7 @@ create_breakpoints_sal (struct gdbarch *gdbarch,
enum bptype type, enum bpdisp disposition,
int thread, int task, int ignore_count,
const struct breakpoint_ops *ops, int from_tty,
- int enabled, int internal)
+ int enabled, int internal, unsigned flags)
{
int i;
struct linespec_sals *lsal;
@@ -8470,7 +8478,7 @@ create_breakpoints_sal (struct gdbarch *gdbarch,
filter_string,
cond_string, type, disposition,
thread, task, ignore_count, ops,
- from_tty, enabled, internal,
+ from_tty, enabled, internal, flags,
canonical->special_display);
discard_cleanups (inner);
}
@@ -8730,7 +8738,8 @@ create_breakpoint (struct gdbarch *gdbarch,
int ignore_count,
enum auto_boolean pending_break_support,
const struct breakpoint_ops *ops,
- int from_tty, int enabled, int internal)
+ int from_tty, int enabled, int internal,
+ unsigned flags)
{
volatile struct gdb_exception e;
char *copy_arg = NULL;
@@ -8870,7 +8879,7 @@ create_breakpoint (struct gdbarch *gdbarch,
cond_string, type_wanted,
tempflag ? disp_del : disp_donttouch,
thread, task, ignore_count, ops,
- from_tty, enabled, internal);
+ from_tty, enabled, internal, flags);
}
else
{
@@ -8946,7 +8955,8 @@ break_command_1 (char *arg, int flag, int from_tty)
&bkpt_breakpoint_ops,
from_tty,
1 /* enabled */,
- 0 /* internal */);
+ 0 /* internal */,
+ 0);
}
/* Helper function for break_command_1 and disassemble_command. */
@@ -10821,7 +10831,8 @@ handle_gnu_v3_exceptions (int tempflag, char *cond_string,
AUTO_BOOLEAN_TRUE /* pending */,
&gnu_v3_exception_catchpoint_ops, from_tty,
1 /* enabled */,
- 0 /* internal */);
+ 0 /* internal */,
+ 0);
return 1;
}
@@ -12048,7 +12059,7 @@ base_breakpoint_create_breakpoints_sal (struct gdbarch *gdbarch,
int task, int ignore_count,
const struct breakpoint_ops *o,
int from_tty, int enabled,
- int internal)
+ int internal, unsigned flags)
{
internal_error_pure_virtual_called ();
}
@@ -12250,13 +12261,13 @@ bkpt_create_breakpoints_sal (struct gdbarch *gdbarch,
int task, int ignore_count,
const struct breakpoint_ops *ops,
int from_tty, int enabled,
- int internal)
+ int internal, unsigned flags)
{
create_breakpoints_sal_default (gdbarch, canonical, lsal,
cond_string, type_wanted,
disposition, thread, task,
ignore_count, ops, from_tty,
- enabled, internal);
+ enabled, internal, flags);
}
static void
@@ -12520,13 +12531,13 @@ tracepoint_create_breakpoints_sal (struct gdbarch *gdbarch,
int task, int ignore_count,
const struct breakpoint_ops *ops,
int from_tty, int enabled,
- int internal)
+ int internal, unsigned flags)
{
create_breakpoints_sal_default (gdbarch, canonical, lsal,
cond_string, type_wanted,
disposition, thread, task,
ignore_count, ops, from_tty,
- enabled, internal);
+ enabled, internal, flags);
}
static void
@@ -12569,7 +12580,7 @@ strace_marker_create_breakpoints_sal (struct gdbarch *gdbarch,
int task, int ignore_count,
const struct breakpoint_ops *ops,
int from_tty, int enabled,
- int internal)
+ int internal, unsigned flags)
{
int i;
@@ -12598,7 +12609,7 @@ strace_marker_create_breakpoints_sal (struct gdbarch *gdbarch,
addr_string, NULL,
cond_string, type_wanted, disposition,
thread, task, ignore_count, ops,
- from_tty, enabled, internal,
+ from_tty, enabled, internal, flags,
canonical->special_display);
/* Given that its possible to have multiple markers with
the same string id, if the user is creating a static
@@ -13303,12 +13314,12 @@ create_breakpoints_sal_default (struct gdbarch *gdbarch,
int task, int ignore_count,
const struct breakpoint_ops *ops,
int from_tty, int enabled,
- int internal)
+ int internal, unsigned flags)
{
create_breakpoints_sal (gdbarch, canonical, cond_string,
type_wanted, disposition,
thread, task, ignore_count, ops, from_tty,
- enabled, internal);
+ enabled, internal, flags);
}
/* Decode the line represented by S by calling decode_line_full. This is the
@@ -14179,7 +14190,7 @@ trace_command (char *arg, int from_tty)
&tracepoint_breakpoint_ops,
from_tty,
1 /* enabled */,
- 0 /* internal */))
+ 0 /* internal */, 0))
set_tracepoint_count (breakpoint_count);
}
@@ -14196,7 +14207,7 @@ ftrace_command (char *arg, int from_tty)
&tracepoint_breakpoint_ops,
from_tty,
1 /* enabled */,
- 0 /* internal */))
+ 0 /* internal */, 0))
set_tracepoint_count (breakpoint_count);
}
@@ -14224,7 +14235,7 @@ strace_command (char *arg, int from_tty)
ops,
from_tty,
1 /* enabled */,
- 0 /* internal */))
+ 0 /* internal */, 0))
set_tracepoint_count (breakpoint_count);
}
@@ -14289,7 +14300,8 @@ create_tracepoint_from_upload (struct uploaded_tp *utp)
&tracepoint_breakpoint_ops,
0 /* from_tty */,
utp->enabled /* enabled */,
- 0 /* internal */))
+ 0 /* internal */,
+ CREATE_BREAKPOINT_FLAGS_INSERTED))
return NULL;
set_tracepoint_count (breakpoint_count);