This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch/MI] Implementation for break-catch command
- From: Vladimir Prus <vladimir at codesourcery dot com>
- To: Nick Roberts <nickrob at snap dot net dot nz>
- Cc: Aleksandar Ristovski <aristovski at qnx dot com>, gdb-patches at sources dot redhat dot com, Eli Zaretskii <eliz at gnu dot org>
- Date: Sun, 1 Jun 2008 09:14:22 +0400
- Subject: Re: [patch/MI] Implementation for break-catch command
- References: <g1jt6h$ebt$1@ger.gmane.org> <200805312006.11811.vladimir@codesourcery.com> <18497.57814.496794.333674@kahikatea.snap.net.nz>
On Sunday 01 June 2008 03:40:06 Nick Roberts wrote:
> > > ?static void enable_delete_breakpoint (struct breakpoint *);
> > > @@ -6549,13 +6547,16 @@ print_mention_exception_catchpoint (stru
> > > ? ?int bp_temp;
> > > ? ?int bp_throw;
> > > ?
> > > - ?bp_temp = b->loc->owner->disposition == disp_del;
> > > - ?bp_throw = strstr (b->addr_string, "throw") != NULL;
> > > - ?ui_out_text (uiout, bp_temp ? _("Temporary catchpoint ")
> > > -??????????????????????? ? ? ?: _("Catchpoint "));
> > > - ?ui_out_field_int (uiout, "bkptno", b->number);
> > > - ?ui_out_text (uiout, bp_throw ? _(" (throw)")
> > > -??????????????????????? ? ? ? : _(" (catch)"));
> > > + ?if (!ui_out_is_mi_like_p (uiout))
> > > + ? ?{
> > > + ? ? ?bp_temp = b->loc->owner->disposition == disp_del;
> > > + ? ? ?bp_throw = strstr (b->addr_string, "throw") != NULL;
> > > + ? ? ?ui_out_text (uiout, bp_temp ? _("Temporary catchpoint ")
> > > +??????????????????????????????? ?: _("Catchpoint "));
> > > + ? ? ?ui_out_field_int (uiout, "bkptno", b->number);
> > > + ? ? ?ui_out_text (uiout, bp_throw ? _(" (throw)")
> > > +??????????????????????????????? ? : _(" (catch)"));
> > > + ? ?}
> >
> > Uh, seems like there's some messiness in MI here. For ordinary breakpoints,
> > MI installs the 'breakpoint_notify' hook that prints all the information,
> > and 'mention' specifically avoids printing anything for MI. For watchpoints,
> > however, no hooks are installed, and 'mention' does print something --
> > basically just id and expression.
> >
> > For -break-catch, you choose to install hooks, and disable printing anything
> > in 'mention' -- seems fine to me.
>
> I think all these "breakpoints" should be changed to use observers. This
> seems to just add to the ugliness.
They definitely should.
- Volodya