United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6272174 -Djava.compiler=NONE and -Xdebug anachronisms unanachronistically disable full-speed debugging
JDK-6272174 : -Djava.compiler=NONE and -Xdebug anachronisms unanachronistically disable full-speed debugging

Details
Type:
Bug
Submit Date:
2005-05-18
Status:
Closed
Updated Date:
2012-02-01
Project Name:
JDK
Resolved Date:
2011-04-24
Component:
hotspot
OS:
generic,windows_xp
Sub-Component:
jvmti
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0,6,6u2
Fixed Versions:
hs11 (b01)

Related Reports
Backport:
Backport:
Backport:
Duplicate:
Relates:

Sub Tasks

Description
The following test case fails pretty much on all the platforms during 
> our nightly runs
> 
> Test Case : nsk/regression/b4516835
> 
> Since the tlog file indicates the dependency on "JVMDI", I was wondering 
> if this is a supported test case
> 
> #==> nsk/regression/b4516835 test LOG:
> #--> This test for #4516835 bug; Category: hotspot; Subcategory: jvmdi
> #    Synopsis: JVMDI: -Djava.compiler=NONE anachronism disables 
> full-speed debugging

------------------------------------------------------

I've looked in the ancient bug report which regressed, and have learned that the 1.3 JPDA front-ends the back-end was launched with this pair of options.  This mean if someone used a debugger built on a 1.3 JDK to debug a program running on a Mustang VM then they wouldn't get full-speed debugging.  Clearly that was a bigger deal during the dvelopment of 1.4 which is when the original bug 4516835 was created.

From what I can see we never spec'ed the interaction between these flags (at least not externally), so we have not broken any contracts.  This twistedly arcane behavior can be restored, if anyone cares, by adding a global flag.  In either case, the code/comments at arguments.cpp:1998 that implements this needs to be dealt with:

      // This must be done after all arguments have been processed.
      // java_compiler() true means set to "NONE" or empty.
      // The -Xdebug mini-agent sets the breakpoint capability (amongst many).
      if (java_compiler() && !JvmtiExport::can_post_breakpoint()) {
        // For backwards compatibility, we switch to interpreted mode if
        // -Djava.compiler="NONE" or "" is specified AND "-Xdebug" was
        // not specified.
        set_mode_flags(_int);
      }

###@###.### 2005-05-18 02:23:57 GMT
###@###.### 2005-05-18 02:36:19 GMT

This bug affects the following NSK test:

    nsk/regression/b4516835

###@###.### 2005-05-25 19:28:37 GMT
Please, see the description of the main CR.
Please, note that the 6u2 should match the JDK 5 behavior to fix the interoperability issue.

                                    

Comments
EVALUATION

NetBeans 4.1 beta still uses it to launch debuggees:

  6925 pts/27   S  0:00 /net/mmm.sfbay/export/home/jjh/jdk1.5.0/jre/bin/java -Xdebug -Xnoagent -Djava.compiler=none -Xrunjdwp:transport=dt_socket,address=localhost:62343 -classpath /home/jjh/AnagramGame/build/classes com.toy.anagrams.ui.Anagrams

I suspect other IDEs do to.  I think we better fix it.

- jjh
###@###.### 2005-05-18 02:40:38 GMT
                                     
2005-05-18
SUGGESTED FIX

Set a global flag on -Xdebug instead of using the breakpoint hack
###@###.### 2005-05-18 02:41:42 GMT
                                     
2005-05-18
EVALUATION

The 6u2 implementation should match jdk 5 behavior. Please, see my comment in the main CR.
It includes processing of the java.compiler proprety, the -Xdebug option and the environment 
variables: JAVA_COMPILER, JAVA_TOOL_OPTIONS and _JAVA_OPTIONS .
                                     
2007-03-21
SUGGESTED FIX

See attached webrev.
                                     
2007-06-27



Hardware and Software, Engineered to Work Together