Re: jdb bug and quick fix

Carlos Konstanski <[email protected]> Wed, 14 Nov 2007 07:55:38 -0700
Newsgroups gmane.emacs.jdee
Message-ID <87abpgho5x.wl%[email protected]>
At Wed, 14 Nov 2007 20:29:48 +0800,
Yee Keat Phuah wrote:
> 
> Hi,
> 
> I have tried using both jdb and jdebug, and finally stuck with jdebug,
> although it requires me to restart the debugger a lot of times before
> working properly. But it provides the nice feature of object browser
> when its working fine. I find it troublesome to use the jdb as I have
> to key in the component i wanted to view, since the jdb prompt does
> not have code completion. Was wondering whether anyone have tried
> hooking speedbar to jdb to make object browser a bit easier.
> 
> Cheers,
> Phuah Yee Keat

Does JDE already already have CEDET dependencies?  If not, the
introduction of such a dependency would have to be carefully
considered.  I find that M-/ works pretty well for completing strings
that have been previously displayed in the jdb buffer.  But I agree
that smarter completion would be neat.  If such a feature is added to
JDE, perhaps it should be part of JDE itself.  How hard would it be to
list all the available java symbols in a completion buffer?  Probably
not all that hard, especially when a lot of the required utilities are
already written, and we have the beanshell at our disposal.

Another, easier feature I would like to see: the jdb buffer gives us
command history with the up and down arrows.  But the history is lost
when jdb is stopped and restarted.  It would be nice if the history
were saved to a file.

Here's another feature dream: you know how java hashmaps have a table
that stores the buckets?  The table is an array that is padded to
length 16 by default.  If you have only one item stored in the
hashmap, that means you have to have to type the following into the
jdb buffer to find the value:

dump myHashMap.table[0]
dump myHashMap.table[1]
dump myHashMap.table[2]
...
dump myHashMap.table[15]

until you find the bucket that is not null.  It would be nice if we
could introduce some jdb "meta-commands" that could automate certain
repetitive tasks like this one.  In this case, a command that would
spit out all the values of an entire array with one meta-command would
suffice.  Then I would only have to type something like:

dumparray myHashMap.table

Carlos Konstanski