--- breakpoint.c | 37 +++++++++++++++++++++++++++++-------- breakpoint.h | 4 +++- mi/mi-cmd-break.c | 2 +- python/py-breakpoint.c | 2 +- python/py-finishbreakpoint.c | 2 +- spu-tdep.c | 2 +- 6 files changed, 36 insertions(+), 13 deletions(-) --- a/breakpoint.c +++ b/breakpoint.c @@ -8073,7 +8073,7 @@ create_breakpoint (struct gdbarch *gdbar 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, int flags) { volatile struct gdb_exception e; char *copy_arg = NULL; @@ -8245,7 +8245,25 @@ create_breakpoint (struct gdbarch *gdbar install_breakpoint (internal, b, 0); } - + + if (flags & CREATE_BREAKPOINT_FLAGS_INSERTED) + { + struct breakpoint *b = NULL; + + ALL_BREAKPOINTS (b) + { + if (b->number == breakpoint_count) + break; + } + if (b) + { + struct bp_location *bl; + + for (bl = b->loc; bl; bl = bl->next) + bl->inserted = 1; + } + } + if (VEC_length (linespec_sals, canonical.sals) > 1) { warning (_("Multiple breakpoints were set.\nUse the " @@ -8289,7 +8307,8 @@ break_command_1 (char *arg, int flag, in &bkpt_breakpoint_ops, from_tty, 1 /* enabled */, - 0 /* internal */); + 0 /* internal */, + 0); } /* Helper function for break_command_1 and disassemble_command. */ @@ -10151,7 +10170,8 @@ handle_gnu_v3_exceptions (int tempflag, AUTO_BOOLEAN_TRUE /* pending */, &gnu_v3_exception_catchpoint_ops, from_tty, 1 /* enabled */, - 0 /* internal */); + 0 /* internal */, + 0); return 1; } @@ -13348,7 +13368,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); } @@ -13365,7 +13385,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); } @@ -13393,7 +13413,7 @@ strace_command (char *arg, int from_tty) ops, from_tty, 1 /* enabled */, - 0 /* internal */)) + 0 /* internal */, 0)) set_tracepoint_count (breakpoint_count); } @@ -13458,7 +13478,8 @@ create_tracepoint_from_upload (struct up &tracepoint_breakpoint_ops, 0 /* from_tty */, utp->enabled /* enabled */, - 0 /* internal */)) + 0 /* internal */, + CREATE_BREAKPOINT_FLAGS_INSERTED)) return NULL; set_tracepoint_count (breakpoint_count); --- a/breakpoint.h +++ b/breakpoint.h @@ -1144,6 +1144,8 @@ extern void extern void install_breakpoint (int internal, struct breakpoint *b, int update_gll); +#define CREATE_BREAKPOINT_FLAGS_INSERTED 1 + extern int create_breakpoint (struct gdbarch *gdbarch, char *arg, char *cond_string, int thread, int parse_condition_and_thread, @@ -1153,7 +1155,7 @@ extern int create_breakpoint (struct gdb const struct breakpoint_ops *ops, int from_tty, int enabled, - int internal); + int internal, int flags); extern void insert_breakpoints (void); --- a/mi/mi-cmd-break.c +++ b/mi/mi-cmd-break.c @@ -168,7 +168,7 @@ mi_cmd_break_insert (char *command, char temp_p, type_wanted, ignore_count, pending ? AUTO_BOOLEAN_TRUE : AUTO_BOOLEAN_FALSE, - &bkpt_breakpoint_ops, 0, enabled, 0); + &bkpt_breakpoint_ops, 0, enabled, 0, 0); do_cleanups (back_to); } --- a/python/py-breakpoint.c +++ b/python/py-breakpoint.c @@ -627,7 +627,7 @@ bppy_init (PyObject *self, PyObject *arg 0, AUTO_BOOLEAN_TRUE, &bkpt_breakpoint_ops, - 0, 1, internal_bp); + 0, 1, internal_bp, 0); break; } case bp_watchpoint: --- a/python/py-finishbreakpoint.c +++ b/python/py-finishbreakpoint.c @@ -288,7 +288,7 @@ bpfinishpy_init (PyObject *self, PyObjec 0, AUTO_BOOLEAN_TRUE, &bkpt_breakpoint_ops, - 0, 1, internal_bp); + 0, 1, internal_bp, 0); } GDB_PY_SET_HANDLE_EXCEPTION (except); --- a/spu-tdep.c +++ b/spu-tdep.c @@ -1947,7 +1947,7 @@ spu_catch_start (struct objfile *objfile 0 /* ignore_count */, AUTO_BOOLEAN_FALSE /* pending_break_support */, &bkpt_breakpoint_ops /* ops */, 0 /* from_tty */, - 1 /* enabled */, 0 /* internal */); + 1 /* enabled */, 0 /* internal */, 0); }