Skip to content

8359958: Cleanup "local" debuggee references after JDK-8333117 removed support for non-local debuggees #25887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -65,7 +65,7 @@ public Process launch() {

String cmd = prepareLaunch(java, argHandler.getPipePort());

Debugee debuggee = binder.startLocalDebugee(cmd);
Debugee debuggee = binder.startDebugee(cmd);
debuggee.redirectOutput(log);

String line = pipe.readln();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -105,7 +105,7 @@ private int runIt(String argv[], PrintStream out) {

Binder binder = new Binder(argHandler, log);
log.display("command: " + cmd);
Debugee debugee = binder.startLocalDebugee(cmd);
Debugee debugee = binder.startDebugee(cmd);
JDWP.ListenAddress listenAddress = debugee.redirectOutputAndDetectListeningAddress(log);
String port = listenAddress.address();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -110,7 +110,7 @@ private int runIt(String argv[], PrintStream out) {

Binder binder = new Binder(argHandler, log);
log.display("command: " + cmd);
Debugee debugee = binder.startLocalDebugee(cmd);
Debugee debugee = binder.startDebugee(cmd);
debugee.redirectOutput(log);

if ((vm = attachTarget(name)) == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -105,7 +105,7 @@ private int runIt(String argv[], PrintStream out) {

Binder binder = new Binder(argHandler, log);
log.display("command: " + cmd);
Debugee debugee = binder.startLocalDebugee(cmd);
Debugee debugee = binder.startDebugee(cmd);
JDWP.ListenAddress listenAddress = debugee.redirectOutputAndDetectListeningAddress(log);
String port = listenAddress.address();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -116,7 +116,7 @@ private int run() {

//vm.setDebugTraceMode(VirtualMachine.TRACE_ALL);
Binder binder = new Binder(argHandler, log);
Debugee debugee = binder.makeLocalDebugee(vm.process());
Debugee debugee = binder.makeDebugee(vm.process());
debugee.redirectOutput(log);
debugee.setupVM(vm);
//debugee.waitForVMInit(1000);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -89,7 +89,7 @@ private int runIt(String argv[], PrintStream out) {

Binder binder = new Binder(argHandler, log);
log.display("command: " + cmd);
Debugee debugee = binder.startLocalDebugee(cmd);
Debugee debugee = binder.startDebugee(cmd);
debugee.redirectOutput(log);

if ((vm = attachTarget()) == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -90,7 +90,7 @@ private int runIt(String argv[], PrintStream out) {

Binder binder = new Binder(argHandler, log);
log.display("command: " + cmd);
Debugee debugee = binder.startLocalDebugee(cmd);
Debugee debugee = binder.startDebugee(cmd);
debugee.redirectOutput(log);

if ((vm = attachTarget()) == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -89,7 +89,7 @@ private int runIt(String argv[], PrintStream out) {

Binder binder = new Binder(argHandler, log);
log.display("command: " + cmd);
Debugee debugee = binder.startLocalDebugee(cmd);
Debugee debugee = binder.startDebugee(cmd);
debugee.redirectOutput(log);

if ((vm = attachTarget()) == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -168,7 +168,7 @@ private int runIt(String argv[], PrintStream out) {

log.display("command: " + cmd);
try {
debugee = binder.startLocalDebugee(cmd);
debugee = binder.startDebugee(cmd);
debugee.redirectOutput(log);
} catch (Exception e) {
stopListen();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -143,7 +143,7 @@ private int runIt(String argv[], PrintStream out) {

log.display("command: " + cmd);
try {
debugee = binder.startLocalDebugee(cmd);
debugee = binder.startDebugee(cmd);
debugee.redirectOutput(log);
} catch (Exception e) {
stopListen();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -150,7 +150,7 @@ private int runThis (String argv[], PrintStream out) {
logOnVerbose(infoLogPrefixHead + "PROCESS is being created:");
logOnVerbose(infoLogPrefix + "Command to run: " + commandToRun);

debugee = binder.startLocalDebugee(commandToRun);
debugee = binder.startDebugee(commandToRun);
debugee.redirectOutput(logHandler);
processToRun = debugee.getProcess();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -151,7 +151,7 @@ private int runThis (String argv[], PrintStream out) {
logOnVerbose(infoLogPrefixHead + "PROCESS is being created:");
logOnVerbose(infoLogPrefix + "Command to run: " + commandToRun);

debugee = binder.startLocalDebugee(commandToRun);
debugee = binder.startDebugee(commandToRun);
debugee.redirectOutput(logHandler);
processToRun = debugee.getProcess();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -154,7 +154,7 @@ private int runThis (String argv[], PrintStream out) {
logOnVerbose(infoLogPrefixHead + "PROCESS is being created:");
logOnVerbose(infoLogPrefix + "Command to run: " + commandToRun);

debugee = binder.startLocalDebugee(commandToRun);
debugee = binder.startDebugee(commandToRun);
debugee.redirectOutput(logHandler);
processToRun = debugee.getProcess();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -150,7 +150,7 @@ private int runThis (String argv[], PrintStream out) {
logOnVerbose(infoLogPrefixHead + "PROCESS is being created:");
logOnVerbose(infoLogPrefix + "Command to run: " + commandToRun);

debugee = binder.startLocalDebugee(commandToRun);
debugee = binder.startDebugee(commandToRun);
debugee.redirectOutput(logHandler);
processToRun = debugee.getProcess();

Expand Down
6 changes: 3 additions & 3 deletions test/hotspot/jtreg/vmTestbase/nsk/share/jdb/Debuggee.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -56,10 +56,10 @@ public class Debuggee extends LocalProcess {
}

/**
* Launch debuggee on local host.
* Launch debuggee.
*/
public void launch(String[] args) throws IOException {
launcher.display("Starting local debuggee.");
launcher.display("Starting debuggee.");

super.launch(args);
redirectStdout(launcher.getLog(), DEBUGEE_STDOUT_LOG_PREFIX );
Expand Down
50 changes: 25 additions & 25 deletions test/hotspot/jtreg/vmTestbase/nsk/share/jdb/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import java.util.*;

/**
* This class provides launching of <code>jdb</code> and debuggee in local
* mode according to test command line options.
* This class provides launching of <code>jdb</code> and debuggee
* according to test command line options.
*/

public class Launcher extends DebugeeBinder {
Expand Down Expand Up @@ -94,27 +94,27 @@ public Launcher (JdbArgumentHandler argumentHandler, Log log) {
}

/**
* Defines mode (local) and type of connector (default, launching,
* Defines type of connector (default, launching,
* raw launching, attaching or listening) according to options
* parsed by <code>JdbArgumentHandler</code>. And then launches <code>jdb</code>
* and debuggee in defined mode.
* and debuggee.
*/
public void launchJdbAndDebuggee (String classToExecute) throws IOException {

String[] jdbCmdArgs = makeJdbCmdLine(classToExecute);

if (argumentHandler.isDefaultConnector()) {
localDefaultLaunch(jdbCmdArgs, classToExecute);
defaultLaunch(jdbCmdArgs, classToExecute);
} else if (argumentHandler.isRawLaunchingConnector()) {
localRawLaunch(jdbCmdArgs, classToExecute);
rawLaunch(jdbCmdArgs, classToExecute);
} else if (argumentHandler.isLaunchingConnector()) {
localLaunch(jdbCmdArgs, classToExecute);
launchFromJdb(jdbCmdArgs, classToExecute);
} else if (argumentHandler.isAttachingConnector()) {
localLaunchAndAttach(jdbCmdArgs, classToExecute);
launchAndAttach(jdbCmdArgs, classToExecute);
} else if (argumentHandler.isListeningConnector()) {
localLaunchAndListen(jdbCmdArgs, classToExecute);
launchAndListen(jdbCmdArgs, classToExecute);
} else {
throw new TestBug("Unexpected connector type for local launch mode"
throw new TestBug("Unexpected connector type: "
+ argumentHandler.getConnectorType());
}

Expand Down Expand Up @@ -255,29 +255,29 @@ private String[] makeJdbCmdLine (String classToExecute) {
// ---------------------------------------------- //

/**
* Run test in local mode using default connector.
* Run test using default connector.
*/
private void localDefaultLaunch
private void defaultLaunch
(String[] jdbCmdArgs, String classToExecute) throws IOException {
localLaunch(jdbCmdArgs, classToExecute);
launchFromJdb(jdbCmdArgs, classToExecute);
}

/**
* Run test in local mode using raw launching connector.
* Run test using raw launching connector.
*/
private void localRawLaunch
private void rawLaunch
(String[] jdbCmdArgs, String classToExecute) throws IOException {
localLaunch(jdbCmdArgs, classToExecute);
launchFromJdb(jdbCmdArgs, classToExecute);
}

/**
* Run test in local mode using launching connector.
* Run test using launching connector.
*/
private void localLaunch
private void launchFromJdb
(String[] jdbCmdArgs, String classToExecute) throws IOException {

jdb = new Jdb(this);
display("Starting jdb launching local debuggee");
display("Starting jdb launching debuggee");
jdb.launch(jdbCmdArgs);

if (classToExecute != null)
Expand All @@ -287,29 +287,29 @@ private String[] makeJdbCmdLine (String classToExecute) {
}

/**
* Run test in local mode using attaching connector.
* Run test using attaching connector.
*/
private void localLaunchAndAttach
private void launchAndAttach
(String[] jdbCmdArgs, String classToExecute) throws IOException {

debuggee = new Debuggee(this);
String address = makeTransportAddress();
String[] javaCmdArgs = makeCommandLineArgs(classToExecute, address);
debuggee.launch(javaCmdArgs);

display("Start jdb attaching to local debuggee");
display("Starting jdb attaching to debuggee");
jdb = Jdb.startAttachingJdb (this, jdbCmdArgs, JDB_STARTED);
// jdb.waitForPrompt(0, false);
}

/**
* Run test in local mode using listening connector.
* Run test using listening connector.
*/
private void localLaunchAndListen
private void launchAndListen
(String[] jdbCmdArgs, String classToExecute) throws IOException {

jdb = new Jdb(this);
display("Starting jdb listening to local debuggee");
display("Starting jdb listening to debuggee");
jdb.launch(jdbCmdArgs);
String address = jdb.waitForListeningJdb();
display("Listening address found: " + address);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -474,14 +474,6 @@ protected void checkOptions() {
+ "jvmdi.strict: non default JVMDI strict mode is not supported now" + getJVMDIStrictMode());
}

/*
if (! isLaunchedLocally() && ! isDefaultJVMDIStrictMode()) {
throw new BadOption("inconsistent options: "
+ "-launch.mode=" + getLaunchMode()
+ " and -jvmdi.strict=" + getJVMDIStrictMode());
}
*/

super.checkOptions();
}
}
Expand Down
Loading