JDB: Argument Parsing Incompatible with Java

Kelly Stephens kms.public0000 at comcast.net
Wed Feb 24 08:26:01 PST 2010


The application I am running requires passing in escaped double quotes.  
Running java works fine, but jdb doesn't.  See the following snippets 
that demonstrate the problem.  The final run may indicate the location 
of the root problem.

Note the following:

*kms at brinn[35]* cat PrintArgs.java
public class PrintArgs {
    public static void main (String[] args) {
        for (String arg : args)
            System.out.println(arg);
    }
}
*kms at brinn[36]* javac PrintArgs.java
*kms at brinn[37]* cat test.sh
#!/bin/sh

java PrintArgs "a \"b\" c"

jdb PrintArgs "a \"b\" c"

java PrintArgs "a \"b\"\" c"

jdb PrintArgs "a \"b\"\" c"
*kms at brinn[38]* ./test.sh
a "b" c
Initializing jdb ...
 > run
run PrintArgs "a \"b\" c"
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
 >
VM Started: a \
b\ c

The application exited
a "b"" c
Internal exception:
java.lang.IllegalArgumentException: Illegal connector argument: 
main=PrintArgs "a \"b\"\" c",
    at 
com.sun.tools.example.debug.tty.VMConnection.parseConnectorArgs(VMConnection.java:127)
    at 
com.sun.tools.example.debug.tty.VMConnection.<init>(VMConnection.java:151)
    at com.sun.tools.example.debug.tty.Env.init(Env.java:53)
    at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1045)
*kms at brinn[39]*

Thanks,
Kelly

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/jdk6-dev/attachments/20100224/75bc3e52/attachment.html 


More information about the jdk6-dev mailing list