private Socket socket;
private BufferedReader reader= null;
private PHPDBGInterface DBGInt= null;
- private IPHPDebugTarget debugTarget;
+ private IPHPDebugTarget debugTarget= null;
private PHPLoop phpLoop;
private PHPThread PHPMainThread;
private int port;
try {
if (server == null) {
server = new ServerSocket(port);
- System.out.println("ServerSocket on port: " + port);
+ //System.out.println("ServerSocket on port: " + port);
}
} catch (IOException e) {
// IO Error
String line;
PHPStackFrame[] StackList;
- System.out.println("Waiting for breakpoints.");
+ //System.out.println("Waiting for breakpoints.");
try{
socket = server.accept();
- System.out.println("Accepted! : " + socket.toString());
+ //System.out.println("Accepted! : " + socket.toString());
} catch (IOException e) {
PHPDebugCorePlugin.log(e);
- return;
+ return;
}
PHPMainThread= new PHPThread(getDebugTarget(), 100);
PHPMainThread.setName("Thread [main]");
+ while(getDebugTarget() == null) {
+ sleep(1000);
+ }
getDebugTarget().addThread(PHPMainThread);
setDBGInterface(new PHPDBGInterface(getReader(), getOutputStream()));
+ DBGInt.waitResponse(1000);
DBGInt.flushAllPackets();
// Check version and session ID
-
setBreakPoints();
DBGInt.continueExecution();
if(StackList.length > 0) {
for(i=0; i < StackList.length; i++) {
StackList[i].setThread(PHPMainThread);
+ StackList[i].setFile(DBGInt.getModByNo(StackList[i].getModNo()));
}
PHPMainThread.setStackFrames(StackList);
}
PHPDebugCorePlugin.log(ex);
System.out.println(ex);
} finally {
- getDebugTarget().terminate();
try {
+ getDebugTarget().terminate();
closeSocket();
closeServerSocket();
} catch (IOException e) {
PHPDebugCorePlugin.log(e);
return;
}
- System.out.println("Socket loop finished.");
+ //System.out.println("Socket loop finished.");
}
}
}