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: [RFC]: Java tab completion


On Fri, May 21, 2004 at 04:03:09PM -0400, Jeff Johnston wrote:
> The attached patch adds support for tab completion for java symbols.  There 
> were two changes required.  First of all, a set of special symbol 
> characters was added.  This is needed because java symbol entries are fully 
> prototyped and make_symbol_completion_list is not prepared for this.
> 
> For example, ptype java.l<tab> should complete the various java.l* symbols. 
> In the current model, make_symbol_completion_list backs up to the "." and 
> tries to complete l*.  This is completely meaningless as things that start 
> with l like long etc.. are not valid.  The same things applies when you try 
> to set the breakpoint for main: e.g. b jmisc.m<tab> won't expand to 
> jmisc.main(java.lang.String[]) which is needed to set the java main 
> breakpoint. With the new patch, this is easy to do and saves a lot of 
>  hassle to start debugging the program.  The same applies to expanding the 
> myriad of system classes that begin with java.lang, etc..
> 
> The second part of the fix is that I had to remove "." from the list of 
> word break characters for java.  I do not know if there is any hidden 
> repercussions of doing this, but there are no testsuite regressions.  I 
> think a similar thing should be done for C++ concerning ":" so completion 
> of namespaces will work.
> 
> I don't know if I should also remove "(", or "," from the word-break 
> characters. These characters also appear in prototypes in the symbol table 
>  and one could easily tab after them when dealing with member names having 
> multiple prototypes.
> 
> I have added a new scenario to jmisc.exp to test completion of b 
> jmisc.m<tab>
> I noticed that the jmisc test-cases were failing on my RHEL3 system because 
> they are currently expecting <init> to be found in the ptype of jmisc, but 
> gdb appears to be doing the right thing and showing the constructor 
> (jmisc()) so I included a fix for that in my gdb.java testsuite patch.
> 
> Ok to commit?

First of all, could you separate the <init> change into its own patch? 
You'll need to ping Anthony Green about that, since he mantains
gdb.java.  I don't know if GDB ought to be displaying jmisc() or
<init>(), but I suspect your patch is right.  Those failures have been
annoying me for a while.

For the rest, I'm just not sure.  Analogy with C++ suggests that we
want to support
 break 'jmisc.main(java.lang.String[])'
 break jmisc.main

Is there any reason to support this form also?
 break jmisc.main(java.lang.String[])

I'm leery of messing with the word break characters.  We're not good
about using the right set for the context; I'm waiting on the next
upstream release of readline (whenever the heck it may be ready) to fix
this.  So this may adversely affect things like filename completion
while debugging Java.

-- 
Daniel Jacobowitz


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