JDK-4516835 : JVMDI: -Djava.compiler=NONE anachronism disables full-speed debugging
  • Type: Bug
  • Component: vm-legacy
  • Sub-Component: jvmdi
  • Affected Version: 1.4.0,5.0
  • Priority: P2
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic,windows_xp
  • CPU: generic,x86
  • Submitted: 2001-10-19
  • Updated: 2007-02-07
  • Resolved: 2007-02-07
Related Reports
Relates :  
Description
The SunCommandLineLauncher has the following hard-coded as part of the 
launch string:

	-Xdebug -Xnoagent -Djava.compiler=NONE 

The "-Djava.compiler=NONE" argument, for backward-compatibility reasons, is 
treated by HotSpot (runtime/arguments.cpp) as a conversion to interpreted mode.

The result is that full-speed debugging (the most significant JPDA feature of
Merlin) is inadvertently disabled by the default and most common mechanism
of using JPDA.

The string "-Xnoagent -Djava.compiler=NONE" is an anachronism left over from
support of the Classic VM.    

This problem was not caught during testing since the test harnesses explicitly
set these parameters (didn't use SunCommandLineLaucnher) to test all modes.
###@###.### 2001-10-18
I'm reopening this, because this fix has stopped to work in JDK 1.6. Was it intentional? This was originally fixed in merlin-rc1 and works fine till 1.5.

With JDK 1.5.0 I get mixed mode as expected after this fix:
java -Xdebug -Xnoagent -Djava.compiler=none -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=localhost:48336 -version
Listening for transport dt_socket at address: 48336
java version "1.5.0_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
Java HotSpot(TM) Server VM (build 1.5.0_08-b03, mixed mode)

But with JDK 1.6.0 I get interpreted mode:
/java -Xdebug -Xnoagent -Djava.compiler=none -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=localhost:48336 -version
Listening for transport dt_socket at address: 48336
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Server VM (build 1.6.0-b105, interpreted mode)

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-rc1 FIXED IN: merlin-rc1 INTEGRATED IN: merlin-rc1 VERIFIED IN: merlin-rc1
14-06-2004

EVALUATION ###@###.### 2001-10-19 % pwd [...]/j2se/src % fegrep "Xnoagent" * <code>-Xrunjdwp:transport=xxx,server=y -Xdebug -Xnoagent -Djava.compiler=NONE</code> * <code>-Xrunjdwp:transport=xxx,address=yyy -Xdebug -Xnoagent -Djava.compiler=NONE</code> ./share/classes/com/sun/jdi/VirtualMachineManager.java "-Xdebug -Xnoagent -Djava.compiler=NONE " + ./share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java ###@###.### 2001-10-22 Due to concerns over IDE tools that may be hardcoded to use SunCommandLineLauncher, we are backing away from changing SunCommandLineLauncher.java for RC. Instead the argument processing done in: $HS/src/share/vm/runtime/arguments.cpp will be modified to ignore -Djava.compiler=NONE if -Xdebug is specified. "-Xdebug" will be equivalent to -Xdebug -Xmixed. If both debugging and interpreted mode is desired, use the "-Xdebug -Xint" flags.
11-06-2004

WORK AROUND Use the raw launcher. Downside is platform dependence.
11-06-2004

PUBLIC COMMENTS .
10-06-2004

SUGGESTED FIX Just remove the offending anachronism, line 151 of SunCommandLineLauncher.java changes from: "-Xdebug -Xnoagent -Djava.compiler=NONE " + to: "-Xdebug " + ###@###.### 2001-10-18
18-10-2001