This is the mail archive of the gdb-patches@sources.redhat.com 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: RFA: add macro commands



"Eli Zaretskii" <eliz@is.elta.co.il> writes:
> > From: Jim Blandy <jimb@redhat.com>
> > 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.",
> > +      &macrolist);
> 
> 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.


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