This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v9 1/3] MI: add the -catch-load and -catch-unload commands


On 10.12.2012 17:16, Mircea Gherzan wrote:
+/* Setup the reporting of the insertion of a new breakpoint
+   or catchpoint.  The flag at CAN_NOTIFY controls whether the
+   notifier may act.  The REV_FLAG is used to return a cleanup
+   for the initial value of CAN_NOTIFY.  */
+
+struct cleanup *
+setup_breakpoint_reporting (void)
+{
+  struct cleanup *rev_flag;
+
+  if (! mi_breakpoint_observers_installed)
+    {
+      observer_attach_breakpoint_created (breakpoint_notify);
+      mi_breakpoint_observers_installed = 1;
+    }
+
+  rev_flag = make_cleanup_restore_integer (&mi_can_breakpoint_notify);
+  mi_can_breakpoint_notify = 1;
+
+  return rev_flag;
+}

Hi Mircea,


I am not sure what is CAN_NOTIFY that the comment refers to - leftover from earlier
revision. I am also not sure that REV_FLAG, being a local variable, is something we can
mention in top-level comment.

How about this:

/* Arrange for all new breakpoints and catchpoints to be reported to CURRENT_UIOUT until
   the cleanup returned by this function is run.

   Note that MI output will be probably invalid if more than one breakpoint is created inside
   one MI command.  */


FAOD, I don't think that any revision to the comment you eventually make will require another round of review.

Thanks,

--
Vladimir Prus
CodeSourcery / Mentor Graphics
http://www.mentor.com/embedded-software/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]