1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-08-10 11:25:09 +00:00

Added -vasmout option that shows the stdout output from KickAsm during compilation.

This commit is contained in:
jespergravgaard
2020-03-12 05:56:57 +01:00
parent d1ec933032
commit c958f7e781

View File

@@ -79,12 +79,15 @@ public class KickC implements Callable<Void> {
@CommandLine.Option(names = {"-Ocache"}, description = "Optimization Option. Enables a fragment cache file.") @CommandLine.Option(names = {"-Ocache"}, description = "Optimization Option. Enables a fragment cache file.")
private boolean optimizeFragmentCache = false; private boolean optimizeFragmentCache = false;
//@CommandLine.Option(names = {"-Oliverangecallpath"}, description = "Optimization Option. Enables live ranges per call path optimization, which limits memory usage and code, but takes a lot of compile time.") @CommandLine.Option(names = {"-Oliverangecallpath"}, description = "Optimization Option. Enables live ranges per call path optimization, which limits memory usage and code, but takes a lot of compile time.")
private boolean optimizeLiveRangeCallPath = true; private boolean optimizeLiveRangeCallPath = false;
@CommandLine.Option(names = {"-v"}, description = "Verbose output describing the compilation process") @CommandLine.Option(names = {"-v"}, description = "Verbose output describing the compilation process")
private boolean verbose = false; private boolean verbose = false;
@CommandLine.Option(names = {"-vasmout"}, description = "Verbosity Option. Show KickAsm standard output during compilation.")
private boolean verboseAsmOut = false;
@CommandLine.Option(names = {"-vparse"}, description = "Verbosity Option. File Parsing.") @CommandLine.Option(names = {"-vparse"}, description = "Verbosity Option. File Parsing.")
private boolean verboseParse = false; private boolean verboseParse = false;
@@ -346,7 +349,6 @@ public class KickC implements Callable<Void> {
if(assemble || execute || debug) { if(assemble || execute || debug) {
Path kasmLogPath = outputDir.resolve(fileBaseName + ".klog"); Path kasmLogPath = outputDir.resolve(fileBaseName + ".klog");
System.out.println("Assembling to " + prgPath.toString()); System.out.println("Assembling to " + prgPath.toString());
ByteArrayOutputStream kasmLogOutputStream = new ByteArrayOutputStream();
String[] assembleCommand = {asmPath.toString(), "-log", kasmLogPath.toString(), "-o", prgPath.toString(), "-vicesymbols", "-showmem", "-debugdump"}; String[] assembleCommand = {asmPath.toString(), "-log", kasmLogPath.toString(), "-o", prgPath.toString(), "-vicesymbols", "-showmem", "-debugdump"};
if(verbose) { if(verbose) {
System.out.print("Assembling command: java -jar kickassembler-5.9.jar "); System.out.print("Assembling command: java -jar kickassembler-5.9.jar ");
@@ -355,7 +357,10 @@ public class KickC implements Callable<Void> {
} }
System.out.println(); System.out.println();
} }
System.setOut(new PrintStream(kasmLogOutputStream)); ByteArrayOutputStream kasmLogOutputStream = new ByteArrayOutputStream();
if(!verboseAsmOut) {
System.setOut(new PrintStream(kasmLogOutputStream));
}
int kasmResult = -1; int kasmResult = -1;
try { try {
CharToPetsciiConverter.setCurrentEncoding("screencode_mixed"); CharToPetsciiConverter.setCurrentEncoding("screencode_mixed");
@@ -365,7 +370,6 @@ public class KickC implements Callable<Void> {
} finally { } finally {
System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out))); System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));
} }
System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));
if(kasmResult != 0) { if(kasmResult != 0) {
throw new CompileError("KickAssembling file failed! " + kasmLogOutputStream.toString()); throw new CompileError("KickAssembling file failed! " + kasmLogOutputStream.toString());
} }