This is the mail archive of the gdb-patches@sourceware.org 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] Patch to limit field name completion candidates


> From: Tom Tromey <tromey@redhat.com>
> Date: Mon, 12 May 2008 17:52:06 -0600
> 
> For a long time now I've accidentally typed things like:
> 
>     p somestruct.<TAB>
> 
> ... and had to wait while gdb dumped all available symbols to gud.
> 
> It seemed to me that gdb should know that I'm trying to complete a
> field expression and limit the completions to fields actually
> occurring in the structure type on the left hand side.

Ooh, another completion junkie!  Good, I'm also hooked.

> I only updated the C parser.  This code works by modifying the lexer
> to return a special COMPLETE token in the important cases.  Note that
> it completes both "p foo.TAB" and "p foo.somethingTAB" correctly --
> the former by making an expression to a field with an empty name.

Thanks.  But what about the situation where I actually want to type

  p foo.c:bar

If I type "p foo.<TAB>", will I see "foo.c" as one of the possible
completions, after your change, whether there is or isn't also a
struct foo in the program?


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