8227229: Deprecate the launcher -Xdebug/-debug flags that have not done anything since Java 6

Reviewed-by: alanb, cjplummer, dholmes
This commit is contained in:
Jaikiran Pai 2023-07-21 12:58:20 +00:00
parent 9e4fc568a6
commit 842d6329cf
25 changed files with 32 additions and 41 deletions

View File

@ -242,7 +242,7 @@
</nbjpdastart> </nbjpdastart>
<property <property
name="@{jpda.jvmargs.property}" name="@{jpda.jvmargs.property}"
value="-Xdebug -Xrunjdwp:transport=dt_socket,address=${jpda.address}" value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"
/> />
</sequential> </sequential>
</macrodef> </macrodef>

View File

@ -86,7 +86,6 @@ char* Arguments::_java_command = nullptr;
SystemProperty* Arguments::_system_properties = nullptr; SystemProperty* Arguments::_system_properties = nullptr;
size_t Arguments::_conservative_max_heap_alignment = 0; size_t Arguments::_conservative_max_heap_alignment = 0;
Arguments::Mode Arguments::_mode = _mixed; Arguments::Mode Arguments::_mode = _mixed;
bool Arguments::_xdebug_mode = false;
const char* Arguments::_java_vendor_url_bug = nullptr; const char* Arguments::_java_vendor_url_bug = nullptr;
const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER; const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER;
bool Arguments::_sun_java_launcher_is_altjvm = false; bool Arguments::_sun_java_launcher_is_altjvm = false;
@ -2655,8 +2654,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
} }
// -Xdebug // -Xdebug
} else if (match_option(option, "-Xdebug")) { } else if (match_option(option, "-Xdebug")) {
// note this flag has been used, then ignore warning("Option -Xdebug was deprecated in JDK 22 and will likely be removed in a future release.");
set_xdebug_mode(true);
// -Xnoagent // -Xnoagent
} else if (match_option(option, "-Xnoagent")) { } else if (match_option(option, "-Xnoagent")) {
warning("Option -Xnoagent was deprecated in JDK 22 and will likely be removed in a future release."); warning("Option -Xnoagent was deprecated in JDK 22 and will likely be removed in a future release.");

View File

@ -250,11 +250,6 @@ class Arguments : AllStatic {
static Mode _mode; static Mode _mode;
static void set_mode_flags(Mode mode); static void set_mode_flags(Mode mode);
// -Xdebug flag
static bool _xdebug_mode;
static void set_xdebug_mode(bool arg) { _xdebug_mode = arg; }
static bool xdebug_mode() { return _xdebug_mode; }
// preview features // preview features
static bool _enable_preview; static bool _enable_preview;

View File

@ -134,7 +134,7 @@ java.launcher.X.usage=\n\
\ append to end of bootstrap class path\n\ \ append to end of bootstrap class path\n\
\ -Xcheck:jni perform additional checks for JNI functions\n\ \ -Xcheck:jni perform additional checks for JNI functions\n\
\ -Xcomp forces compilation of methods on first invocation\n\ \ -Xcomp forces compilation of methods on first invocation\n\
\ -Xdebug does nothing. Provided for backward compatibility.\n\ \ -Xdebug does nothing; deprecated for removal in a future release.\n\
\ -Xdiag show additional diagnostic messages\n\ \ -Xdiag show additional diagnostic messages\n\
\ -Xfuture enable strictest checks, anticipating future default.\n\ \ -Xfuture enable strictest checks, anticipating future default.\n\
\ This option is deprecated and may be removed in a\n\ \ This option is deprecated and may be removed in a\n\

View File

@ -838,8 +838,7 @@ Testing mode to exercise JIT compilers.
This option should not be used in production environments. This option should not be used in production environments.
.TP .TP
\f[V]-Xdebug\f[R] \f[V]-Xdebug\f[R]
Does nothing. Does nothing; deprecated for removal in a future release.
Provided for backward compatibility.
.TP .TP
\f[V]-Xdiag\f[R] \f[V]-Xdiag\f[R]
Shows additional diagnostic messages. Shows additional diagnostic messages.

View File

@ -1390,7 +1390,7 @@ ParseArguments(int *pargc, char ***pargv,
} else if (JLI_StrCmp(arg, "-tm") == 0) { } else if (JLI_StrCmp(arg, "-tm") == 0) {
AddOption("-Xtm", NULL); AddOption("-Xtm", NULL);
} else if (JLI_StrCmp(arg, "-debug") == 0) { } else if (JLI_StrCmp(arg, "-debug") == 0) {
AddOption("-Xdebug", NULL); JLI_ReportErrorMessage(ARG_DEPRECATED, "-debug");
} else if (JLI_StrCmp(arg, "-noclassgc") == 0) { } else if (JLI_StrCmp(arg, "-noclassgc") == 0) {
AddOption("-Xnoclassgc", NULL); AddOption("-Xnoclassgc", NULL);
} else if (JLI_StrCmp(arg, "-Xfuture") == 0) { } else if (JLI_StrCmp(arg, "-Xfuture") == 0) {

View File

@ -225,7 +225,6 @@ public class SunCommandLineLauncher extends AbstractLauncher {
String command = exePath + ' ' + String command = exePath + ' ' +
options + ' ' + options + ' ' +
"-Xdebug " +
"-Xrunjdwp:" + xrun + ' ' + "-Xrunjdwp:" + xrun + ' ' +
mainClassAndArgs; mainClassAndArgs;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,8 +25,8 @@
* @test * @test
* @bug 6294277 * @bug 6294277
* @requires vm.jvmti * @requires vm.jvmti
* @summary java -Xdebug crashes on SourceDebugExtension attribute larger than 64K * @summary verify that the JVM doesn't crash when SourceDebugExtension attribute is larger than 64K
* @run main/othervm -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n SourceDebugExtension * @run main/othervm -Xrunjdwp:transport=dt_socket,server=y,suspend=n SourceDebugExtension
*/ */
import java.io.*; import java.io.*;

View File

@ -97,7 +97,7 @@ public class attach001 {
String java = argHandler.getLaunchExecPath() String java = argHandler.getLaunchExecPath()
+ " " + argHandler.getLaunchOptions(); + " " + argHandler.getLaunchOptions();
String cmd = java String cmd = java
+ " -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=0" + " -Xrunjdwp:transport=dt_socket,server=y,address=0"
+ " " + DEBUGEE_CLASS; + " " + DEBUGEE_CLASS;
Binder binder = new Binder(argHandler, log); Binder binder = new Binder(argHandler, log);

View File

@ -102,7 +102,7 @@ public class attach002 extends Log {
String java = argHandler.getLaunchExecPath() String java = argHandler.getLaunchExecPath()
+ " " + argHandler.getLaunchOptions(); + " " + argHandler.getLaunchOptions();
String cmd = java + String cmd = java +
" -Xdebug -Xrunjdwp:transport=dt_shmem,server=y,address=" + " -Xrunjdwp:transport=dt_shmem,server=y,address=" +
name + " " + DEBUGEE_CLASS; name + " " + DEBUGEE_CLASS;
Binder binder = new Binder(argHandler, log); Binder binder = new Binder(argHandler, log);

View File

@ -97,7 +97,7 @@ public class attachnosuspend001 {
String java = argHandler.getLaunchExecPath() String java = argHandler.getLaunchExecPath()
+ " " + argHandler.getLaunchOptions(); + " " + argHandler.getLaunchOptions();
String cmd = java String cmd = java
+ " -Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0" + " -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0"
+ " " + DEBUGEE_CLASS; + " " + DEBUGEE_CLASS;
Binder binder = new Binder(argHandler, log); Binder binder = new Binder(argHandler, log);

View File

@ -134,7 +134,7 @@ public class launch003 {
Connector.Argument a = (Connector.Argument) cava[i]; Connector.Argument a = (Connector.Argument) cava[i];
if (a.name().equals("command")) if (a.name().equals("command"))
a.setValue(java + a.setValue(java +
" -Xdebug -Xrunjdwp:suspend=y,transport=" + " -Xrunjdwp:suspend=y,transport=" +
TRANSPORT_NAME + TRANSPORT_NAME +
",address=" + host + ":" + port + ",address=" + host + ":" + port +
" " + DEBUGEE_CLASS); " " + DEBUGEE_CLASS);

View File

@ -133,7 +133,7 @@ public class launch004 {
Connector.Argument a = (Connector.Argument) cava[i]; Connector.Argument a = (Connector.Argument) cava[i];
if (a.name().equals("command")) if (a.name().equals("command"))
a.setValue(java + a.setValue(java +
" -Xdebug -Xrunjdwp:suspend=y,transport=" + " -Xrunjdwp:suspend=y,transport=" +
TRANSPORT_NAME + TRANSPORT_NAME +
",address=" + name + ",address=" + name +
" " + DEBUGEE_CLASS); " " + DEBUGEE_CLASS);

View File

@ -81,7 +81,7 @@ public class accept001 {
String java = argHandler.getLaunchExecPath() String java = argHandler.getLaunchExecPath()
+ " " + argHandler.getLaunchOptions(); + " " + argHandler.getLaunchOptions();
String cmd = java + String cmd = java +
" -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=" + " -Xrunjdwp:transport=dt_socket,server=n,address=" +
connAddr + " " + DEBUGEE_CLASS; connAddr + " " + DEBUGEE_CLASS;
Binder binder = new Binder(argHandler, log); Binder binder = new Binder(argHandler, log);

View File

@ -82,7 +82,7 @@ public class accept002 {
String java = argHandler.getLaunchExecPath() String java = argHandler.getLaunchExecPath()
+ " " + argHandler.getLaunchOptions(); + " " + argHandler.getLaunchOptions();
String cmd = java + String cmd = java +
" -Xdebug -Xrunjdwp:transport=dt_shmem,server=n,address=" + " -Xrunjdwp:transport=dt_shmem,server=n,address=" +
connAddr + " " + DEBUGEE_CLASS; connAddr + " " + DEBUGEE_CLASS;
Binder binder = new Binder(argHandler, log); Binder binder = new Binder(argHandler, log);

View File

@ -81,7 +81,7 @@ public class listennosuspend001 {
String java = argHandler.getLaunchExecPath() String java = argHandler.getLaunchExecPath()
+ " " + argHandler.getLaunchOptions(); + " " + argHandler.getLaunchOptions();
String cmd = java + String cmd = java +
" -Xdebug -Xrunjdwp:transport=dt_socket,server=n,suspend=n,address=" + " -Xrunjdwp:transport=dt_socket,server=n,suspend=n,address=" +
connAddr + " " + DEBUGEE_CLASS; connAddr + " " + DEBUGEE_CLASS;
Binder binder = new Binder(argHandler, log); Binder binder = new Binder(argHandler, log);

View File

@ -157,7 +157,7 @@ public class startlis001 {
+ " " + argHandler.getLaunchOptions(); + " " + argHandler.getLaunchOptions();
String cmd = java + String cmd = java +
" -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=" + " -Xrunjdwp:transport=dt_socket,server=n,address=" +
addr + " " + DEBUGEE_CLASS; addr + " " + DEBUGEE_CLASS;
Binder binder = new Binder(argHandler, log); Binder binder = new Binder(argHandler, log);

View File

@ -132,7 +132,7 @@ public class startlis002 {
+ " " + argHandler.getLaunchOptions(); + " " + argHandler.getLaunchOptions();
String cmd = java + String cmd = java +
" -Xdebug -Xrunjdwp:transport=dt_shmem,server=n,address=" + " -Xrunjdwp:transport=dt_shmem,server=n,address=" +
addr + " " + DEBUGEE_CLASS; addr + " " + DEBUGEE_CLASS;
Binder binder = new Binder(argHandler, log); Binder binder = new Binder(argHandler, log);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -131,7 +131,7 @@ public class createVM002 {
String targetJava = argsHandler.getLaunchExecPath() String targetJava = argsHandler.getLaunchExecPath()
+ " " + argsHandler.getLaunchOptions(); + " " + argsHandler.getLaunchOptions();
String commandToRun = targetJava + " -Xdebug -Xrunjdwp:transport=dt_socket,address=" + String commandToRun = targetJava + " -Xrunjdwp:transport=dt_socket,address=" +
testTransportServiceListenKey.address() + testTransportServiceListenKey.address() +
// Addind "suspend=n' option helps avoid debugee hang. See 6803636. // Addind "suspend=n' option helps avoid debugee hang. See 6803636.
",suspend=n" + ",suspend=n" +

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -136,7 +136,7 @@ public class createVM003 {
String targetJava = argsHandler.getLaunchExecPath() String targetJava = argsHandler.getLaunchExecPath()
+ " " + argsHandler.getLaunchOptions(); + " " + argsHandler.getLaunchOptions();
String commandToRun = targetJava + " -Xdebug -Xrunjdwp:transport=dt_socket,address=" + String commandToRun = targetJava + " -Xrunjdwp:transport=dt_socket,address=" +
testTransportServiceListenKey.address() + " " + targetVMClassName; testTransportServiceListenKey.address() + " " + targetVMClassName;
Binder binder = new Binder(argsHandler, logHandler); Binder binder = new Binder(argsHandler, logHandler);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -139,7 +139,7 @@ public class createVM004 {
String targetJava = argsHandler.getLaunchExecPath() String targetJava = argsHandler.getLaunchExecPath()
+ " " + argsHandler.getLaunchOptions(); + " " + argsHandler.getLaunchOptions();
String commandToRun = targetJava + " -Xdebug -Xrunjdwp:transport=dt_socket,address=" + String commandToRun = targetJava + " -Xrunjdwp:transport=dt_socket,address=" +
testTransportServiceListenKey.address() + " " + targetVMClassName; testTransportServiceListenKey.address() + " " + targetVMClassName;
Binder binder = new Binder(argsHandler, logHandler); Binder binder = new Binder(argsHandler, logHandler);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -135,7 +135,7 @@ public class createVM005 {
String targetJava = argsHandler.getLaunchExecPath() String targetJava = argsHandler.getLaunchExecPath()
+ " " + argsHandler.getLaunchOptions(); + " " + argsHandler.getLaunchOptions();
String commandToRun = targetJava + " -Xdebug -Xrunjdwp:transport=dt_socket,address=" + String commandToRun = targetJava + " -Xrunjdwp:transport=dt_socket,address=" +
testTransportServiceListenKey.address() + " " + targetVMClassName; testTransportServiceListenKey.address() + " " + targetVMClassName;
Binder binder = new Binder(argsHandler, logHandler); Binder binder = new Binder(argsHandler, logHandler);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -144,7 +144,7 @@ public class SimpleLaunchingConnector implements LaunchingConnector {
String exe = System.getProperty("java.home") + File.separator + "bin" + String exe = System.getProperty("java.home") + File.separator + "bin" +
File.separator + "java"; File.separator + "java";
String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" + String cmd = exe + " -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
key.address() + key.address() +
" -classpath " + System.getProperty("test.classes") + " -classpath " + System.getProperty("test.classes") +
" " + className; " " + className;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -90,7 +90,7 @@ public class HTMLTransferTest {
String javaPath = System.getProperty("java.home", ""); String javaPath = System.getProperty("java.home", "");
String cmd = javaPath + File.separator + "bin" + File.separator String cmd = javaPath + File.separator + "bin" + File.separator
+ "java -cp " + System.getProperty("test.classes", ".") + + "java -cp " + System.getProperty("test.classes", ".") +
//+ "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 " //+ "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 "
" THTMLConsumer" " THTMLConsumer"
//+ stFormats //+ stFormats
; ;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -79,7 +79,7 @@ public class DragUnicodeBetweenJVMTest {
ProcessResults processResults = ProcessResults processResults =
// ProcessCommunicator.executeChildProcess(this.getClass()," -cp \"C:\\Documents and Settings\\df153228\\IdeaProjects\\UnicodeTestDebug\\out\\production\\UnicodeTestDebug\" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 ", args); // ProcessCommunicator.executeChildProcess(this.getClass()," -cp \"C:\\Documents and Settings\\df153228\\IdeaProjects\\UnicodeTestDebug\\out\\production\\UnicodeTestDebug\" -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 ", args);
ProcessCommunicator.executeChildProcess(this.getClass(), args); ProcessCommunicator.executeChildProcess(this.getClass(), args);
verifyTestResults(processResults); verifyTestResults(processResults);