|
[E-p-i-c-commits] org.epic.debug/src/org/epic/debug PerlDB.java,1.30,1.31
From: Stephan Ruehl <stephan_ruehl@us...> - 2004-12-16 16:20
|
Update of /cvsroot/e-p-i-c/org.epic.debug/src/org/epic/debug
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5121/src/org/epic/debug
Modified Files:
PerlDB.java
Log Message:
Index: PerlDB.java
===================================================================
RCS file: /cvsroot/e-p-i-c/org.epic.debug/src/org/epic/debug/PerlDB.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- PerlDB.java 15 Dec 2004 14:24:45 -0000 1.30
+++ PerlDB.java 16 Dec 2004 16:19:43 -0000 1.31
@@ -26,7 +26,11 @@
import java.util.StringTokenizer;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
@@ -150,7 +154,7 @@
public boolean mStopVarUpdate;
private String mVarLocalString;
private String mVarGlobalString;
- private VarUpdateThread mVarUpdateThread;
+ private VarUpdateJob mVarUpdateJob;
private StackFrame mStackFrameOrg;
private class IP_Position {
int IP_Line;
@@ -293,7 +297,8 @@
generateDebugInitEvent();
} else
generateDebugTermEvent();
-
+
+
}
/*
* (non-Javadoc)
@@ -1093,9 +1098,9 @@
mThreads[0].setStackFrames(frames);
mIsCommandFinished = true;
- if (mVarUpdateThread != null)
+ if (mVarUpdateJob != null)
try {
- mVarUpdateThread.join();
+ mVarUpdateJob.join();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -1105,9 +1110,9 @@
mIsCommandRunning = false;
mIsCommandFinished = true;
- mVarUpdateThread = new VarUpdateThread(fOutputString);
- mVarUpdateThread.setPriority(Thread.MIN_PRIORITY);
- mVarUpdateThread.start();
+ mVarUpdateJob = new VarUpdateJob("Retrieve Variables",fOutputString);
+ mVarUpdateJob.setPriority(Job.SHORT);
+ mVarUpdateJob.schedule();;
}
private IP_Position getCurrent_IP_Position() {
@@ -1151,7 +1156,7 @@
}
- private void setVarStrings() {
+ private void setVarStrings(IProgressMonitor fMon) {
String command;
String result;
boolean ret;
@@ -1176,19 +1181,22 @@
}
}
}
-
+ fMon.worked(40);
ret = startCommand(mCommandExecuteCode, command, false, mThreads);
+ fMon.worked(50);
if (!ret || this.mStopVarUpdate)
return;
result = evaluateStatement(mThreads[0], mGlobalVarCommand, false);
-
+ fMon.worked(70);
+
command = "o frame=2\n";
if (mPerlVersion.startsWith("5.6"))
command = "O frame=2\n";
mVarGlobalString = result;
- System.out.println(mVarGlobalString);
+
+ //System.out.println(mVarGlobalString);
}
@@ -1548,23 +1556,26 @@
}
}
- public class VarUpdateThread extends Thread {
+ public class VarUpdateJob extends Job {
private String mString;
- public VarUpdateThread(String fString) {
+ public VarUpdateJob(String fName, String fString) {
+ super(fName);
mString = fString;
}
- public void run() {
+ public IStatus run(IProgressMonitor fMon) {
+ fMon.beginTask("Vars",100);
StackFrame frame = null;
System.err.println("Start+++++++++++++++++" + mIsCommandFinished);
try {
for (int x = 0; (x < 5) && !mStopVarUpdate; x++)
- sleep(100);
+ Thread.sleep(100);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
+ fMon.worked(10);
}
System.err.println("Start 0+++++++++++++++++" + mIsCommandFinished);
@@ -1572,13 +1583,13 @@
if (mStopVarUpdate == true) {
System.err.println("Exit 0+++++++++++++++++"
+ mIsCommandFinished);
- return;
+ return( Status.OK_STATUS );
}
- setVarStrings();
+ setVarStrings(fMon);
try {
if (mThreads[0].getStackFrames() == null)
- return;
+ return( Status.OK_STATUS );
frame = (StackFrame) mThreads[0].getStackFrames()[0];
} catch (DebugException e1) {
// TODO Auto-generated catch block
@@ -1590,21 +1601,27 @@
if (mStopVarUpdate == true) {
System.err.println("Exit 1+++++++++++++++++"
+ mIsCommandFinished);
- return;
+ return( Status.OK_STATUS );
}
setVarList(frame);
+ fMon.worked(85);
System.err.println("Start 2+++++++++++++++++" + mIsCommandFinished);
if (mStopVarUpdate == true) {
System.err.println("Exit 2+++++++++++++++++"
+ mIsCommandFinished);
- return;
+ return( Status.OK_STATUS );
}
updateStackFramesFinish(mString);
+ fMon.worked(95);
System.err.println("Start 3+++++++++++++++++" + mIsCommandFinished);
if (mStopVarUpdate == true)
- return;
+ return( Status.OK_STATUS );
generateDebugEvalEvent();
+ fMon.done();
+ return( Status.OK_STATUS );
+
}
-
+
}
+
};
\ No newline at end of file
|
| Thread | Author | Date |
|---|---|---|
| [E-p-i-c-commits] org.epic.debug/src/org/epic/debug PerlDB.java,1.30,1.31 | Stephan Ruehl <stephan_ruehl@us...> |