This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v9 1/3] MI: add the -catch-load and -catch-unload commands
- From: Vladimir Prus <vladimir at codesourcery dot com>
- To: Mircea Gherzan <mircea dot gherzan at intel dot com>
- Cc: <gdb-patches at sourceware dot org>, <keven dot boell at intel dot com>, <marc dot khouzam at ericsson dot com>, <tromey at redhat dot com>
- Date: Tue, 11 Dec 2012 09:32:12 +0400
- Subject: Re: [PATCH v9 1/3] MI: add the -catch-load and -catch-unload commands
- References: <1355145401-7438-1-git-send-email-mircea.gherzan@intel.com>
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/