org.chromium.debug.core/src/org/chromium/debug/core/model/VProjectWorkspaceBridge.java
changeset 214 3a649437adec
parent 115 d367ed1b2991
child 276 f2f4a1259de8
equal deleted inserted replaced
213:05aa67beb24d 214:3a649437adec
     8 
     8 
     9 import org.chromium.debug.core.ChromiumDebugPlugin;
     9 import org.chromium.debug.core.ChromiumDebugPlugin;
    10 import org.chromium.debug.core.util.ChromiumDebugPluginUtil;
    10 import org.chromium.debug.core.util.ChromiumDebugPluginUtil;
    11 import org.chromium.sdk.Breakpoint;
    11 import org.chromium.sdk.Breakpoint;
    12 import org.chromium.sdk.CallFrame;
    12 import org.chromium.sdk.CallFrame;
       
    13 import org.chromium.sdk.DebugContext;
       
    14 import org.chromium.sdk.ExceptionData;
    13 import org.chromium.sdk.JavascriptVm;
    15 import org.chromium.sdk.JavascriptVm;
    14 import org.chromium.sdk.Script;
    16 import org.chromium.sdk.Script;
    15 import org.chromium.sdk.JavascriptVm.BreakpointCallback;
    17 import org.chromium.sdk.JavascriptVm.BreakpointCallback;
    16 import org.chromium.sdk.JavascriptVm.ScriptsCallback;
    18 import org.chromium.sdk.JavascriptVm.ScriptsCallback;
    17 import org.eclipse.core.resources.IFile;
    19 import org.eclipse.core.resources.IFile;
   263       return vmEmbedder.getTargetName();
   265       return vmEmbedder.getTargetName();
   264     }
   266     }
   265 
   267 
   266     public String getThreadLabel(JavascriptThread thread) {
   268     public String getThreadLabel(JavascriptThread thread) {
   267       String url = thread.getDebugTarget().getJavascriptEmbedder().getThreadName();
   269       String url = thread.getDebugTarget().getJavascriptEmbedder().getThreadName();
   268       return NLS.bind(Messages.JsThread_ThreadLabelFormat, (thread.isSuspended()
   270       return NLS.bind(Messages.JsThread_ThreadLabelFormat, getThreadStateLabel(thread), (url.length() > 0
   269           ? Messages.JsThread_ThreadLabelSuspended
       
   270           : Messages.JsThread_ThreadLabelRunning), (url.length() > 0
       
   271           ? (" : " + url) : "")); //$NON-NLS-1$ //$NON-NLS-2$
   271           ? (" : " + url) : "")); //$NON-NLS-1$ //$NON-NLS-2$
       
   272     }
       
   273 
       
   274     private String getThreadStateLabel(JavascriptThread thread) {
       
   275       if (thread.isSuspended()) {
       
   276         DebugContext context = thread.getDebugTarget().getDebugContext();
       
   277         ExceptionData exceptionData = context.getExceptionData();
       
   278         if (exceptionData != null) {
       
   279           return NLS.bind(Messages.JsThread_ThreadLabelSuspendedExceptionFormat,
       
   280               exceptionData.getExceptionMessage());
       
   281         } else {
       
   282           return Messages.JsThread_ThreadLabelSuspended;
       
   283         }
       
   284       } else {
       
   285         return Messages.JsThread_ThreadLabelRunning;
       
   286       }
   272     }
   287     }
   273 
   288 
   274     public String getStackFrameLabel(StackFrame stackFrame) throws DebugException {
   289     public String getStackFrameLabel(StackFrame stackFrame) throws DebugException {
   275       CallFrame callFrame = stackFrame.getCallFrame();
   290       CallFrame callFrame = stackFrame.getCallFrame();
   276       String name = callFrame.getFunctionName();
   291       String name = callFrame.getFunctionName();