X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGProxy.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGProxy.java index 5c1f627..1c73cf9 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGProxy.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGProxy.java @@ -138,7 +138,7 @@ public class PHPDBGProxy { int bpNo= 0; try { PHPLineBreakpoint phpLBP; - if(breakpoint.getModelIdentifier() == PHPDebugCorePlugin.getDefault().getDescriptor().getUniqueIdentifier()) { + if(breakpoint.getModelIdentifier() == PHPDebugCorePlugin.getUniqueIdentifier()) { IPath filename; phpLBP= (PHPLineBreakpoint)breakpoint; // bpNo= DBGInt.addBreakpoint(phpLBP.getMarker().getResource().getLocation().toOSString(), phpLBP.getLineNumber()); @@ -162,7 +162,7 @@ public class PHPDBGProxy { if (DBGInt == null) return; try { PHPLineBreakpoint phpLBP; - if(breakpoint.getModelIdentifier() == PHPDebugCorePlugin.getDefault().getDescriptor().getUniqueIdentifier()) { + if(breakpoint.getModelIdentifier() == PHPDebugCorePlugin.getUniqueIdentifier()) { phpLBP= (PHPLineBreakpoint)breakpoint; IPath filename; if (remote) @@ -228,15 +228,18 @@ public class PHPDBGProxy { throw new RuntimeException(ex.getMessage()); } } - - public PHPVariable[] readInstanceVariables(PHPVariable variable) { + + public PHPVariable[] eval(PHPStackFrame frame,String evalString) { try { - return DBGInt.getInstVars(variable); + return DBGInt.evalBlock(frame,evalString); + // return DBGInt.getVariables(frame); + } catch (IOException ioex) { + ioex.printStackTrace(); + throw new RuntimeException(ioex.getMessage()); } catch (DebugException ex) { ex.printStackTrace(); throw new RuntimeException(ex.getMessage()); } - } public void readStepOverEnd(PHPStackFrame stackFrame) { @@ -345,16 +348,16 @@ public class PHPDBGProxy { while (!shouldStop) { newconnect=true; - try { - newSocket = server.accept(); + try { + newSocket = server.accept(); //System.out.println("Accepted! : " + socket.toString()); - } catch (SocketTimeoutException e) { + } catch (SocketTimeoutException e) { // no one wants to connect newconnect=false; - } catch (IOException e) { - PHPDebugCorePlugin.log(e); - return; - } + } catch (IOException e) { + PHPDebugCorePlugin.log(e); + return; + } if (newconnect) { @@ -362,84 +365,81 @@ public class PHPDBGProxy { server.setSoTimeout(1); newDBGInt= new PHPDBGInterface(getReader(newSocket), newSocket.getOutputStream(), thisProxy); newDBGInt.waitResponse(1000); - newDBGInt.flushAllPackets(); + newDBGInt.flushAllPackets(); // Check version and session ID - if ((DBGInt==null) || (DBGInt.getSID()==newDBGInt.getSID())) - { - DBGInt=newDBGInt; + if ((DBGInt==null) || (DBGInt.getSID()==newDBGInt.getSID())) + { + DBGInt=newDBGInt; try { closeSocket(); } catch (IOException e) { PHPDebugCorePlugin.log(e); shouldStop=true; } - socket=newSocket; + socket=newSocket; setBreakPoints(); DBGInt.continueExecution(); - } else - { + } else + { newDBGInt.continueExecution(); - newSocket.close(); - } + newSocket.close(); + } } - if(DBGInt.waitResponse(interval)) - { + if(DBGInt.waitResponse(interval)) + { - DBGInt.flushAllPackets(); - - if (DBGInt.BPUnderHit != 0) { - StackList = DBGInt.getStackList(); - if (StackList.length > 0) { - for (i = 0; i < StackList.length; i++) { - StackList[i].setThread(PHPMainThread); - if (DBGInt.getModByNo(StackList[i].getModNo()).equals("")) { - DBGInt.getSourceTree(); - } - StackList[i].setFile( - DBGInt.getModByNo(StackList[i].getModNo())); - } - PHPMainThread.setStackFrames(StackList); - } - // Fire debug event - PHPMainThread.suspend(); - - synchronized (this) { - wait(); - } - } - } - if (remote) { - if (PHPMainThread.isTerminated()) - { - shouldStop=true; - break; - } - } else { - if (PHPMainThread.isTerminated() || getDebugTarget().getProcess().isTerminated()) - { + DBGInt.flushAllPackets(); + + if (DBGInt.BPUnderHit != 0) { + StackList = DBGInt.getStackList(); + if (StackList.length > 0) { + for (i = 0; i < StackList.length; i++) { + StackList[i].setThread(PHPMainThread); + if (DBGInt.getModByNo(StackList[i].getModNo()).equals("")) { + DBGInt.getSourceTree(); + } + StackList[i].setFile( + DBGInt.getModByNo(StackList[i].getModNo())); + } + PHPMainThread.setStackFrames(StackList); + } + // Fire debug event + PHPMainThread.suspend(); + + synchronized (this) { + wait(); + } + } + } + if (remote) { + if (PHPMainThread.isTerminated()) { + shouldStop=true; + break; + } + } else { + if (PHPMainThread.isTerminated() || getDebugTarget().getProcess().isTerminated()) { shouldStop=true; break; - } - } + } + } + } + } + catch (Exception ex) { + PHPDebugCorePlugin.log(ex); + System.out.println(ex); + } + finally { + try { + getDebugTarget().terminate(); + closeSocket(); + closeServerSocket(); + } catch (IOException e) { + PHPDebugCorePlugin.log(e); + return; } - } - catch (Exception ex) { - PHPDebugCorePlugin.log(ex); - System.out.println(ex); - } - finally { - try { - getDebugTarget().terminate(); - closeSocket(); - closeServerSocket(); - } - catch (IOException e) { - PHPDebugCorePlugin.log(e); - return; - } //System.out.println("Socket loop finished."); - } + } } } }