Add -debug flag to shell. Will cause it to generate debug for compiled class

files.


git-svn-id: svn://10.0.0.236/trunk@224694 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nboyd%atg.com
2007-04-18 17:08:42 +00:00
parent 378ffe4eeb
commit 8a4e9b2d46
3 changed files with 12 additions and 1 deletions

View File

@@ -59,7 +59,8 @@ msg.shell.usage =\
\ -version 100|110|120|130|140|150|160\n\
\ -opt [-1|0-9]\n\
\ -f script-filename\n\
\ -e script-source
\ -e script-source\n\
\ -debug
msg.help =\

View File

@@ -280,6 +280,10 @@ public class Main
global.setSealedStdLib(true);
continue;
}
if (arg.equals("-debug")) {
shellContextFactory.setGeneratingDebug(true);
continue;
}
usageError = arg;
break goodUsage;
}

View File

@@ -45,6 +45,7 @@ public class ShellContextFactory extends ContextFactory
private boolean strictMode;
private int languageVersion;
private int optimizationLevel;
private boolean generatingDebug;
private ErrorReporter errorReporter;
protected boolean hasFeature(Context cx, int featureIndex)
@@ -64,6 +65,7 @@ public class ShellContextFactory extends ContextFactory
if (errorReporter != null) {
cx.setErrorReporter(errorReporter);
}
cx.setGeneratingDebug(generatingDebug);
super.onContextCreated(cx);
}
@@ -93,4 +95,8 @@ public class ShellContextFactory extends ContextFactory
this.errorReporter = errorReporter;
}
public void setGeneratingDebug(boolean generatingDebug)
{
this.generatingDebug = generatingDebug;
}
}