Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8193237: SA: ClhsdbLauncher should show the command being executed
Reviewed-by: sspitsyn, amenkov
  • Loading branch information
plummercj committed Feb 27, 2020
1 parent 3a5ee7b commit 511501048c879e3835f3ff901606d76882c691c6
Showing with 12 additions and 5 deletions.
  1. +12 −5 test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java
@@ -113,15 +113,22 @@ private String runCmd(List<String> commands,
throw new RuntimeException("CLHSDB command must be provided\n");
}

// Enable verbose exception tracing so we see the full exception backtrace
// when there is a failure. We need to insert this command into the start
// of the commands list. We can't just issue the "verbose true" command seperately
// We want to execute clhsdb "echo" and "verbose" commands before the
// requested commands. We can't just issue these commands separately
// because code below won't work correctly if all executed commands are
// not in the commands list. And since it's immutable, we need to allocate
// a mutable one.
// not in the commands list. Since the commands list is immutable, we
// need to allocate a mutable one that we can add the extra commands too.
List<String> savedCommands = commands;
commands = new java.util.LinkedList<String>();

// Enable echoing of all commands so we see them in the output.
commands.add("echo true");

// Enable verbose exception tracing so we see the full exception backtrace
// when there is a failure.
commands.add("verbose true");

// Now add all the original commands after the "echo" and "verbose" commands.
commands.addAll(savedCommands);

try (OutputStream out = toolProcess.getOutputStream()) {

0 comments on commit 5115010

Please sign in to comment.