2012-03-13 Hui Zhu <teawater@gmail.com>
authorPedro Alves <palves@redhat.com>
Tue, 13 Mar 2012 22:18:19 +0000 (22:18 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 13 Mar 2012 22:18:19 +0000 (22:18 +0000)
    Pedro Alves  <palves@redhat.com>

* breakpoint.c (init_breakpoint_sal): New flags parameter.  Handle
CREATE_BREAKPOINT_FLAGS_INSERTED.
(create_breakpoint_sal, create_breakpoints_sal)
(create_breakpoint): New flags parameter.  Pass it 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.

gdb/ChangeLog
gdb/breakpoint.c
gdb/breakpoint.h
gdb/mi/mi-cmd-break.c
gdb/python/py-breakpoint.c
gdb/python/py-finishbreakpoint.c
gdb/spu-tdep.c

index 917a77f..6d6d62c 100644 (file)
@@ -1,3 +1,21 @@
+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)
+       (create_breakpoint): New flags parameter.  Pass it 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.
+
 2012-03-13  Pedro Alves  <palves@redhat.com>
            Hui Zhu  <teawater@gmail.com>
            Yao Qi  <yao@codesourcery.com>
index a0beb15..5a8c29c 100644 (file)
@@ -7248,7 +7248,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;
 
@@ -7294,6 +7295,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;
@@ -7337,6 +7341,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))
@@ -7369,7 +7375,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;
@@ -7392,7 +7399,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);
@@ -7420,7 +7428,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;
@@ -7444,7 +7452,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);
     }
@@ -7704,7 +7712,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;
@@ -7886,7 +7895,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,
                                   canonical.special_display);
              /* Given that its possible to have multiple markers with
                 the same string id, if the user is creating a static
@@ -7906,7 +7915,7 @@ create_breakpoint (struct gdbarch *gdbarch,
                                type_wanted,
                                tempflag ? disp_del : disp_donttouch,
                                thread, task, ignore_count, ops, from_tty,
-                               enabled, internal);
+                               enabled, internal, flags);
     }
   else
     {
@@ -7982,7 +7991,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.  */
@@ -9838,7 +9848,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;
 }
@@ -12769,7 +12780,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);
 }
 
@@ -12786,7 +12797,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);
 }
 
@@ -12805,7 +12816,7 @@ strace_command (char *arg, int from_tty)
                         &tracepoint_breakpoint_ops,
                         from_tty,
                         1 /* enabled */,
-                        0 /* internal */))
+                        0 /* internal */, 0))
     set_tracepoint_count (breakpoint_count);
 }
 
@@ -12870,7 +12881,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);
index c1d3be9..3548d13 100644 (file)
@@ -1105,6 +1105,16 @@ extern void
 extern void install_breakpoint (int internal, struct breakpoint *b,
                                int update_gll);
 
+/* Flags that can be passed down to create_breakpoint, etc., to affect
+   breakpoint creation in several ways.  */
+
+enum breakpoint_create_flags
+  {
+    /* We're adding a breakpoint to our tables that is already
+       inserted in the target.  */
+    CREATE_BREAKPOINT_FLAGS_INSERTED = 1 << 0
+  };
+
 extern int create_breakpoint (struct gdbarch *gdbarch, char *arg,
                              char *cond_string, int thread,
                              int parse_condition_and_thread,
@@ -1114,7 +1124,7 @@ extern int create_breakpoint (struct gdbarch *gdbarch, char *arg,
                              const struct breakpoint_ops *ops,
                              int from_tty,
                              int enabled,
-                             int internal);
+                             int internal, unsigned flags);
 
 extern void insert_breakpoints (void);
 
index d73f96a..e04d34d 100644 (file)
@@ -168,7 +168,7 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
                     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);
 
 }
index 195ed2b..0c84d03 100644 (file)
@@ -627,7 +627,7 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
                               0,
                               AUTO_BOOLEAN_TRUE,
                               &bkpt_breakpoint_ops,
-                              0, 1, internal_bp);
+                              0, 1, internal_bp, 0);
            break;
          }
         case bp_watchpoint:
index b0c16b5..e083576 100644 (file)
@@ -288,7 +288,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
                          0,
                          AUTO_BOOLEAN_TRUE,
                          &bkpt_breakpoint_ops,
-                         0, 1, internal_bp);
+                         0, 1, internal_bp, 0);
     }
   GDB_PY_SET_HANDLE_EXCEPTION (except);
   
index 17dae90..78ba007 100644 (file)
@@ -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);
 }