1. Sergey Kolos
  2. lispdev

Commits

sk  committed bd5fd28

When thread is suspended, the reason is shown in thread label.

  • Participants
  • Parent commits be3a333
  • Branches default

Comments (0)

Files changed (3)

File plugin.xml

View file
  • Ignore whitespace
             type="org.lispdev.replview.localLaunchConfigurationType">
       </launchConfigurationTabGroup>
    </extension>
+   <extension
+         point="org.eclipse.debug.ui.debugModelPresentations">
+      <debugModelPresentation
+            class="org.lispdev.replview.DebugModelPresentation"
+            id="org.lispdev.debug.model">
+      </debugModelPresentation>
+   </extension>
 
 </plugin>

File src/org/lispdev/replview/DebugModelPresentation.java

View file
  • Ignore whitespace
+package org.lispdev.replview;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IValue;
+import org.eclipse.debug.ui.IDebugModelPresentation;
+import org.eclipse.debug.ui.IDebugModelPresentationExtension;
+import org.eclipse.debug.ui.IValueDetailListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.ui.IEditorInput;
+import org.lispdev.log.Log;
+import org.lispdev.swank.debug.LispThread;
+
+public class DebugModelPresentation extends LabelProvider implements
+    IDebugModelPresentation, IDebugModelPresentationExtension
+{
+
+  @Override
+  public String getText(Object element)
+  {
+    if( element instanceof LispThread )
+    {
+      return getThreadText((LispThread)element);
+    }
+    return null;
+  }
+
+  private String getThreadText(LispThread thread)
+  {
+    String label = "";
+    try
+    {
+      label = thread.getName();
+    }
+    catch(DebugException e)
+    {
+      Log.logException(e);
+    }
+    if( thread.isSuspended() )
+    {
+      label += " : " + thread.getError();
+    }
+    return label;
+  }
+
+  @Override
+  public IEditorInput getEditorInput(Object element)
+  {
+    return null;
+  }
+
+  @Override
+  public String getEditorId(IEditorInput input, Object element)
+  {
+    return null;
+  }
+
+  @Override
+  public void setAttribute(String attribute, Object value)
+  {}
+
+  @Override
+  public void computeDetail(IValue value, IValueDetailListener listener)
+  {}
+
+  @Override
+  public boolean requiresUIThread(Object element)
+  {
+    return (element instanceof LispThread);
+  }
+
+}

File src/org/lispdev/replview/ReplConsolePage.java

View file
  • Ignore whitespace
       try
       {
         process.getLaunch().getDebugTarget().getThreads()[0].resume();
+        process.getLaunch().getDebugTarget().resume();
       }
       catch(DebugException e)
       {