Hello,

Following is a patch to jde.debugger.Application.java to set the -classic
flag as an VM Launching Connector Argument to attach the classic VM:

345c345,355
<        commandLine += quote + iterator.next() + quote + " ";
---
>     String arg = (String)iterator.next();
>     if (arg.equalsIgnoreCase("-classic")) {
>       Connector.Argument optionsArg =
>           (Connector.Argument)argumentMap.get("options");
>       String options = optionsArg.value();
>       options = "-classic" + " " + options;
>       optionsArg.setValue(options);
>        signal(MESSAGE, "VM options: '" + options + "'");
>     }
>     else
>       commandLine += quote + arg + quote + " ";

The "options" connector argument must be used to set options, in addition
to the standard debugging options.

In the current version of Application.java the -classic option is set as an
application command line argument and not recognized as a valid VM option.

Hope this helps.

Sincerely,

David






Paul Kinnucan <[EMAIL PROTECTED]> on 09/21/99 19:56:46

Pour :    Robert Field <[EMAIL PROTECTED]>
cc :  Jim Piersol <[EMAIL PROTECTED]>, [EMAIL PROTECTED],
      [EMAIL PROTECTED] (ccc : David PONCE/FR/Schneider)
Objet :   RE: Error starting JDEbug




At 10:25 AM 9/21/99 -0700, Robert Field wrote:
>==> At 03:49 PM 9/20/99 -0500, you wrote:
>==> >Paul,
>==> >
>==> >Thanks for the info on turning this option off.  I turned it off only
to
>==> >find a bug in the JPDA/HOTSPOT combo that causes the VM to die
randomly.
>==> >What I would like to do is have the -classic flag set.  My error
results
>==> >from the -classic arg not being the first argument to the VM.  If I
run
>==> the >same command as JDEbug tries, it fails stating that the -classic
is an
>==> >invalid argument.  If I move the -classic argument to the front of
the
>==> >command-line, it works as expected.  Are you able to run with the
-classic
>==> >arg in an arbitrary possition ?  I was under the impression that it
had to
>==> >be first.  Here is my JDEbug beffer again.  also attached my .emacs &
a
>==> >common lisp file. >
>==>
>==> Okay, I guess I'm confused. The reason I included the "classic-mode"
>==> variable was to insures that the -classic switch is always first on
the
>==> command-line because I had heard that that was required. By "first" I
>==> thougth this was meant
>==>
>==>   java -classic other-args
>==>
>==> rather than this
>==>
>==>   java some-args -classic some-other-args
>==>
>==> This is what the -classic mode switch now does.
>==>
>==> In the case of JDEBug, there is no way of guaranteeing that the
-classic
>==> switch is first on the command line. This is because JPDA constructs
the
>==> java command line by combining the args it needs with whatever args
you
>==> specify. The args that JPDA requires always go first on the command
line
>==> followed by the user's args. AFAIK there is no way for JDEBug to
manipulate
>==> this order to ensure that -classic goes before all other arguments.
>
>Paul,
>Both from my reading of the code and my tests, the user supplied
>options go first, for example:
>
>/export/1.3/build/solaris/bin/../bin/sparc/green_threads/java -classic
>-Xdebug -Xnoagent -Djava.compiler=NONE
>-Xrunjdwp:transport=dt_socket,address=palau:55272,suspend=y A
>
>Can you send the generated command line.
>

Here is a transcript of a JDEBug session using the -classic option:

Line 1 javaw -classpath
d:/jde-2.1.6beta9/java/lib/jde.jar;d:/jpda/lib/jpda.jar jde.debugger.Main
Line 2
Line 3
Line 4 (jde-dbo-init-debug-session)
Line 5
Line 6 JDE> -1 1 launch 1 -use_executable javaw -classic -classpath
d:/jmath/classes;d:/jmath/src jmath.Test
Line 7
Line 8
Line 9
Line 10 (jde-dbo-command-error
Line 11 1 "VM initialization failed for:
D:\Applications\JavaSoft\JRE\1.2\bin\javaw -Xdebug -Xnoagent
-Djava.compiler=NONE
-Xrunjdwp:transport=dt_shmem,address=javadebug,suspend=y -classic
-classpath d:/jmath/classes;d:/jmath/src jmath.Test")


Line 1 Starts the debugger.
Line 4 Acknowledgement from the debugger.
Line 6 Launch command. Note inclusion of the -classic option as first of
the user-supplied arguments.
Line 7 Error message showing the command line that the debugger attempted
to use to start the application.
       Note that the user-supplied arguments, e.g., -classic, -classpath,
come after the arguments generated
       by the debugger.

I haven't yet checked Amit's code so I don't know whether the problem lies
with the JDEBug java code or with JPDA.

- Paul




Reply via email to