Hi Klaus,

Thank you for offering to contribute to jdb and the OpenJDK project. Although your suggestion would help to improve jdb, it isn't really within the current goals for jdb. jdb is primarily used for the following:

 * Testing of JDI and JDWP: We have a large number of jdb tests that
   are primary maintained to help find JDI and JDWP bugs, not so much
   to test jdb itself.
 * As example JDI client code for debuggers to use as a reference.
 * As a useful platform for reproducing JDI and JDWP bugs. Often IDE
   vendors find JDI and JDWP bugs that initially are reproduced with
   their own IDE, but they file bugs using jdb as a reproducer. This
   provides much simpler reproducer for the serviceability team to work
   with.

One things jdb is not meant for is as a production debugging tool. There are many java IDE's out there that are much better suited for that. We currently do not wish to spend effort improving the quality of jdb as a debugger, and instead want to focus on improving jdb where it is useful the in above 3 use case.

best regard,

Chris

On 10/16/26 11:07 PM, Klaus Wiltgen Klein wrote:
Hello all,
I am interested in doing some work to improve the current state of JDB in the JDK. My initial idea is rather simple, and if we find it a good thing, I would be happy to upstream it.

I want to add readline support to JDB. Currently, any bash/EMACS shortcut, such as CTRL + W or CTRL + A/E, is read as a literal character. I know we can reuse the existing readline implementation from jshell, but in order to do that, it's necessary to create a dedicated module for JDB, rather than keeping its code within jdk.jdi.
In short, my proposal is:
-Create a new module at the root src named jdk.jdb, and move the code from jdk.jdi/share/classes/com/sun/tools/example/debug/tty/ to jdk.jdb/share
-Update the imports to match the new location
-Update any existing (broken) script
-Update the src/jdk.internal.le/share/classes/module-info.java file to contain the newly added module, and start using readline in JDB.

This would provide some of the groundwork needed to improve JDB in other areas, such as autocomplete for commands, classes, methods, etc. Let me know if this sounds reasonable or useful to others so we can discuss it further.

Kind regards
Klaus Klein

Reply via email to