Commits

Anonymous committed 66ceac3

Changing signatures to use debug info structures.

Comments (0)

Files changed (5)

src/org/lispdev/swank/ISwank.java

   void sendInterrupt(SwankRunnable callBack);
   void setPackage(String p);
   String getCurrPackage();
-  void sendDebug(String commandNum, String sldbLevel,
-      String threadId, SwankRunnable callBack);
+  /**
+   * Send debug restart.
+   * @param commandNum restart index
+   * @param info debug info obtained at debug start
+   * @param callBack leave it null if want to process events through listeners
+   */
+  void sendDebug(int commandNum, SwankDebugInfo info, SwankRunnable callBack);
   void sendListThreads(SwankRunnable callBack);
 
   public LispVariable[] getFrameLocals(int frameNum, String threadId,

src/org/lispdev/swank/LispThread.java

 package org.lispdev.swank;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.eclipse.debug.core.DebugException;
 import org.eclipse.debug.core.model.IBreakpoint;
 import org.eclipse.debug.core.model.IStackFrame;
 import org.eclipse.debug.core.model.IThread;
-import org.lispdev.swank.SwankDebugInfo.SwankDebugRestart;
 
 public class LispThread extends LispDebugElement implements IThread
 {
     return null;
   }
 
-  public int getDebugLevel()
+  public SwankDebugInfo getDebugInfo()
   {
-    if( isSuspended() && debugInfo != null )
+    if( isSuspended() )
     {
-      return debugInfo.level;
+      return debugInfo;
     }
-    return -1;
-  }
-
-  public List<SwankDebugRestart> getRestarts()
-  {
-    if( isSuspended() && debugInfo != null )
-    {
-      return debugInfo.restarts;
-    }
-    else
-    {
-      return new ArrayList<SwankDebugRestart>();
-    }
+    return null;
   }
 
   @Override

src/org/lispdev/swank/SwankEvent.java

   DEBUG_ACTIVATE(":debug-activate"),
   /**
    * Event with debug info, usually right before a :debug-activate.
+   * Use {@link LispImplementation#getDebugInfo} to translate contents
+   * of result {@link LispNode} of corresponding {@link SwankRunnable}
+   * to {@link SwankDebugInfo}
    */
   DEBUG(":debug"),
   /**

src/org/lispdev/swank/SwankInterface.java

     swank.sendEvalRaw(msg, "COMMON-LISP-USER", callBack);
   }
 
-  public synchronized void sendDebug(String commandNum, String sldbLevel,
-      String threadId, SwankRunnable callBack)
+  @Override
+  public synchronized void sendDebug(int commandNum, SwankDebugInfo info,
+      SwankRunnable callBack)
   {
     String msg =
-        "(swank:invoke-nth-restart-for-emacs " + sldbLevel + " " + commandNum
-            + ")";
-    swank.sendEvalRawWithThread(msg, "nil", threadId, callBack);
+        "(swank:invoke-nth-restart-for-emacs " + String.valueOf(info.level)
+        + " " + String.valueOf(commandNum) + ")";
+    swank.sendEvalRawWithThread(msg, "nil", info.thread, callBack);
   }
 
   public synchronized void sendQuitDebug(SwankRunnable callBack, String threadId)

src/org/lispdev/swank/SwankInterfaceTest.java

       {
         SwankDebugInfo info =
           si.getLispImplementation().getDebugInfo(debugInfo.result);
-        si.sendDebug("1", String.valueOf(info.level), info.thread, callBack);
+        si.sendDebug(1, info, callBack);
       }
     };
     final SwankRunnable debugStop = new SwankRunnable(){