--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java Thu Nov 30 15:05:03 2017 +0100
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java Thu Nov 30 19:46:20 2017 +0530
@@ -53,10 +53,12 @@
private void attach(long lingeredAppPid)
throws IOException {
- System.out.println("Starting clhsdb against " + lingeredAppPid);
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhsdb");
launcher.addToolArg("clhsdb");
- launcher.addToolArg("--pid=" + Long.toString(lingeredAppPid));
+ if (lingeredAppPid != -1) {
+ launcher.addToolArg("--pid=" + Long.toString(lingeredAppPid));
+ System.out.println("Starting clhsdb against " + lingeredAppPid);
+ }
ProcessBuilder processBuilder = new ProcessBuilder(launcher.getCommand());
processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);