more work on debugger

This commit is contained in:
benfry
2009-11-28 15:29:12 +00:00
parent 0c568c24d6
commit 2158a572ae
3 changed files with 18 additions and 6 deletions
+2 -2
View File
@@ -77,8 +77,8 @@ public class Runner implements MessageConsumer {
//private PrintStream leechErr;
protected Editor editor;
protected Sketch sketch;
protected String appletClassName;
private Sketch sketch;
private String appletClassName;
public Runner(RunnerListener listener) {
@@ -236,6 +236,7 @@ public class Android implements Tool {
};
emulatorProcess = Runtime.getRuntime().exec(cmd);
System.out.println(PApplet.join(cmd, " "));
// "emulator: ERROR: the user data image is used by another emulator. aborting"
// make sure that the streams are drained properly
new StreamRedirectThread("android-emulator-out",
emulatorProcess.getInputStream(), System.out).start();
@@ -530,9 +531,11 @@ public class Android implements Tool {
"-s", device,
//"-d", // this is for a single USB device
"shell", "am", "start", // kick things off
"-e", "debug", "true",
"-a", "android.intent.action.MAIN", "-n",
build.getPackageName() + "/." + build.getClassName()
"-D", // debug
// "-e", "debug", "true",
"-a", "android.intent.action.MAIN",
"-c", "android.intent.category.LAUNCHER",
"-n", build.getPackageName() + "/." + build.getClassName()
});
int result = p.waitFor();
if (result != 0) {
@@ -452,14 +452,23 @@ public class AndroidRunner extends Runner {
// Any of the thread.blah() methods can throw an AbsentInformationEx
// if that bit of data is missing. If so, just write out the error
// message to the console.
Sketch sketch = editor.getSketch();
String appletClassName = sketch.getName(); // TODO * not yet correct! *
List<StackFrame> framey = thread.frames();
for (StackFrame frame : framey) {
System.out.println("frame: " + frame);
}
List<StackFrame> frames = thread.frames();
for (StackFrame frame : frames) {
System.out.println("frame: " + frame);
// System.out.println("frame: " + frame);
Location location = frame.location();
String filename = null;
filename = location.sourceName();
lineNumber = location.lineNumber();
String appletJavaFile = appletClassName + ".java";
SketchCode errorCode = null;
if (filename.equals(appletJavaFile)) {