< prev index next >
test/jdk/com/sun/jdi/lib/jdb/JdbTest.java
Print this page
*** 43,52 ****
--- 43,54 ----
public static class LaunchOptions {
public final String debuggeeClass;
public final List<String> debuggeeOptions = new LinkedList<>();
public String sourceFilename;
+ public final List<String> debuggerOptions = new LinkedList<>();
+
public LaunchOptions(String debuggeeClass) {
this.debuggeeClass = debuggeeClass;
}
public LaunchOptions addDebuggeeOption(String option) {
*** 59,68 ****
--- 61,81 ----
}
public LaunchOptions setSourceFilename(String name) {
sourceFilename = name;
return this;
}
+
+ public LaunchOptions addDebuggerOptions(String[] options) {
+ debuggerOptions.addAll(Arrays.asList(options));
+ return this;
+ }
+
+ public LaunchOptions addDebuggerOption(String option) {
+ debuggerOptions.add(option);
+ return this;
+ }
+
}
public JdbTest(LaunchOptions launchOptions) {
this.launchOptions = launchOptions;
}
*** 139,149 ****
throw new RuntimeException("failed to launch debuggee", ex);
}
// launch jdb
try {
! jdb = new Jdb("-connect", "com.sun.jdi.SocketAttach:port=" + debuggeeListen[1]);
} catch (Throwable ex) {
// terminate debuggee if something went wrong
debuggee.destroy();
throw ex;
}
--- 152,167 ----
throw new RuntimeException("failed to launch debuggee", ex);
}
// launch jdb
try {
! List<String> jdbOptions = new LinkedList<>();
! jdbOptions.add("-connect");
! jdbOptions.add("com.sun.jdi.SocketAttach:port=" + debuggeeListen[1]);
! jdbOptions.addAll(launchOptions.debuggerOptions);
!
! jdb = new Jdb(jdbOptions);
} catch (Throwable ex) {
// terminate debuggee if something went wrong
debuggee.destroy();
throw ex;
}
*** 236,246 ****
.transform(id, launchOptions.debuggeeClass, compilerOptions);
return jdb.command(JdbCommand.redefine(launchOptions.debuggeeClass, transformedClassFile));
}
// gets full test source path for the given test filename
! protected static String getTestSourcePath(String fileName) {
return Paths.get(System.getProperty("test.src")).resolve(fileName).toString();
}
// verifies that sourceFilename is specified in ctor
private void verifySourceFilename() {
--- 254,264 ----
.transform(id, launchOptions.debuggeeClass, compilerOptions);
return jdb.command(JdbCommand.redefine(launchOptions.debuggeeClass, transformedClassFile));
}
// gets full test source path for the given test filename
! public static String getTestSourcePath(String fileName) {
return Paths.get(System.getProperty("test.src")).resolve(fileName).toString();
}
// verifies that sourceFilename is specified in ctor
private void verifySourceFilename() {
< prev index next >