From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6601 invoked by alias); 10 May 2002 15:55:49 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6575 invoked from network); 10 May 2002 15:55:47 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 10 May 2002 15:55:47 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id C1FFE5EA11; Fri, 10 May 2002 10:55:45 -0500 (EST) To: Eli Zaretskii Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: add macro commands References: <20020509235822.DC4F95EA11@zwingli.cygnus.com> <8011-Fri10May2002101418+0300-eliz@is.elta.co.il> From: Jim Blandy Date: Fri, 10 May 2002 08:55:00 -0000 In-Reply-To: <8011-Fri10May2002101418+0300-eliz@is.elta.co.il> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-05/txt/msg00336.txt.bz2 "Eli Zaretskii" writes: > > From: Jim Blandy > > Date: Thu, 9 May 2002 18:58:22 -0500 (EST) > > > > + add_cmd > > + ("expand", no_class, macro_expand_command, > > + "Fully expand any C/C++ preprocessor macro invocations in EXPRESSION.\n" > > + "Show the expanded expression.", > > + ¯olist); > > Do I understand correctly that this command definition, as well as > others you added in this patch, makes the command use the default > completion function? If so, I'm not sure that's a good idea, unless > the tables scanned by make_symbol_completion_list store macro names. > > It would be nice to have completion only on macro names in these > commands. But if that cannot be done easily, at least let's disable > completion entirely until something appropriate is coded. I hadn't thought about completion at all. Given that the macros are stored in a splay tree, they're all sorted in a way that would make efficient completion straightforward. So it wouldn't be too hard to write a macro-only completion function. But the argument is an expression. People may want to use real variable names in the expressions they expand: they may not want to substitute short dummy names for the long variable names in the expression they have inmind. So why should it complete differently from other expressions? Why shouldn't GDB help people use long variable names in their expressions to expand? I think a better change would be to simply include macro names in the completion process.