From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19413 invoked by alias); 14 Feb 2012 03:12:53 -0000 Received: (qmail 19401 invoked by uid 22791); 14 Feb 2012 03:12:51 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Feb 2012 03:12:38 +0000 Received: by vbip1 with SMTP id p1so4551610vbi.0 for ; Mon, 13 Feb 2012 19:12:38 -0800 (PST) Received: by 10.52.20.142 with SMTP id n14mr8007814vde.59.1329189158194; Mon, 13 Feb 2012 19:12:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.20.142 with SMTP id n14mr8007808vde.59.1329189158117; Mon, 13 Feb 2012 19:12:38 -0800 (PST) Received: by 10.220.162.7 with HTTP; Mon, 13 Feb 2012 19:12:38 -0800 (PST) In-Reply-To: <03E840D17E263A48A5766AD576E0423A03D72B653F@exch-mbx-111.vmware.com> References: <03E840D17E263A48A5766AD576E0423A03D72B653F@exch-mbx-111.vmware.com> Date: Tue, 14 Feb 2012 03:12:00 -0000 Message-ID: Subject: Re: [PATCH] Allow user-defined as a category for python gdb macros (resend) From: Doug Evans To: Scott Goldman Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-Gm-Message-State: ALoCoQlNgTsOqII3OBAer2pqKRbMUGWBgdHL5Nw7RFKJF5ha0BEKPWM4i1JYp5b78CABTu3hsBCtvLlbICKf/mOJPdBKUD0/Peh4U78KVr3Tf0WU1cuqlGLJvTXEP+WbxJLvi2LtIownNL/HimK5TjqrwzlR9H1svA== X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00249.txt.bz2 On Mon, Feb 13, 2012 at 4:48 PM, Scott Goldman wrote: > --- a/gdb/top.c > +++ b/gdb/top.c > @@ -470,7 +470,7 @@ execute_command (char *p, int from_tty) > =A0 =A0 =A0 if (c->flags & DEPRECATED_WARN_USER) > =A0 =A0 =A0 =A0deprecated_cmd_warning (&line); > > - =A0 =A0 =A0if (c->class =3D=3D class_user) > + =A0 =A0 =A0if (c->class =3D=3D class_user && c->user_commands) > =A0 =A0 =A0 =A0execute_user_command (c, arg); > =A0 =A0 =A0 else if (c->type =3D=3D set_cmd || c->type =3D=3D show_cmd) > =A0 =A0 =A0 =A0do_setshow_command (arg, from_tty, c); This change is a bit obscure. At the very least, I think this requires a proper comment explaining why one needs to test c->user_commands. Also, this patch feels like it's incomplete. If I can see "user" python "macros" [sic] then happens if I do "show user foo"? (a user may reasonably ask) And given that that won't work, we'll have to explain(document) why. Plus one now needs to explain that "document" and "max-user-call-depth" don't apply to these commands (it may seem obvious, but they show up in "apropos user-defined", and thus to not document these things means the patch is incomplete). I wonder if any more unforeseen changes will be needed.