repl: dump bytecode command
This commit is contained in:
@@ -25,6 +25,7 @@ import org.jetbrains.jet.utils.ExceptionUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -130,6 +131,11 @@ public class ReplFromTerminal {
|
||||
System.out.println("Available commands are:");
|
||||
System.out.println(":help show this help");
|
||||
System.out.println(":quit exit the interpreter");
|
||||
System.out.println(":dump bytecode dump classes to terminal");
|
||||
return true;
|
||||
}
|
||||
else if (command.equals("dump bytecode")) {
|
||||
getReplInterpreter().dumpClasses(new PrintWriter(System.out));
|
||||
return true;
|
||||
}
|
||||
else if (command.equals("quit")) {
|
||||
|
||||
@@ -59,6 +59,7 @@ import org.jetbrains.jet.utils.ExceptionUtils;
|
||||
import org.jetbrains.jet.utils.Progress;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -219,4 +220,8 @@ public class ReplInterpreter {
|
||||
|
||||
return scriptDescriptor;
|
||||
}
|
||||
|
||||
public void dumpClasses(@NotNull PrintWriter out) {
|
||||
classLoader.dumpClasses(out);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user