jdb has 3 types of arguments:
1. Those that are jdb specific, such as -attach, -launch, and -listconnectors
2. Those that are passed to the JVM used to run jdb. These are all prefixed with -J, and any valid JVM argument can be passed in this manner.
3. Those that are passed to the debuggee JVM when it is launched, such as -classpath, -D<property>, and any option that starts with -X (including -XX)
The problem with the 3rd group is that (other than for -D and -X), jdb will only pass through arguments that it recognizes, and that list is very limited. When you want to launch the debuggee with an argument that jdb doesn't recognize, you have no choice but to launch the debuggee yourself (using a separate command line and using the -agentlib:jdwp argument) and then tell jdb to attach to the debuggee process. It's much easier when you can just let jdb launch the debuggee, and our nsk/jdb testing currently relies on this feature.
I'd like to add jdb support for -R<option> which will pass <option> when launching the debuggee JVM. jshell also passes arguments to the debuggee by using -R, so it seems to be a good precedent to follow.
1. Those that are jdb specific, such as -attach, -launch, and -listconnectors
2. Those that are passed to the JVM used to run jdb. These are all prefixed with -J, and any valid JVM argument can be passed in this manner.
3. Those that are passed to the debuggee JVM when it is launched, such as -classpath, -D<property>, and any option that starts with -X (including -XX)
The problem with the 3rd group is that (other than for -D and -X), jdb will only pass through arguments that it recognizes, and that list is very limited. When you want to launch the debuggee with an argument that jdb doesn't recognize, you have no choice but to launch the debuggee yourself (using a separate command line and using the -agentlib:jdwp argument) and then tell jdb to attach to the debuggee process. It's much easier when you can just let jdb launch the debuggee, and our nsk/jdb testing currently relies on this feature.
I'd like to add jdb support for -R<option> which will pass <option> when launching the debuggee JVM. jshell also passes arguments to the debuggee by using -R, so it seems to be a good precedent to follow.
- csr for
-
JDK-8282830 add jdb "-R" option for passing any argument to the launched debuggee process
- Closed
- relates to
-
JDK-8282988 nsk/jdb and com/sun/jdi tests do not run jdb or debuggee with specified JVM args
- Open