void enterDebugger() { try { throw new DebugException(); } catch (DebugException e) { //no-op } }
/** * Handles the given exception, which occurred during edit/save. */ protected void handleException(DebugException e) { Throwable cause = e.getStatus().getException(); if (cause instanceof InvalidTypeException) { IStatus status = new Status(IStatus.ERROR, JDIDebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, cause.getMessage(), null); JDIDebugUIPlugin.statusDialog(ActionMessages.JavaObjectValueEditor_3, status); } else { JDIDebugUIPlugin.statusDialog(e.getStatus()); } }
@Override public void handleException(DebugException e) { showMessage(e.getMessage()); }
target.terminate(); } catch (DebugException e) { status.merge(e.getStatus()); target.disconnect(); } catch (DebugException de) { status.merge(de.getStatus()); process.terminate(); } catch (DebugException e) { status.merge(e.getStatus()); throw new DebugException(children[0]); throw new DebugException(status);
public static String[] getErrorMessages(IEvaluationResult result) { if (result == null) { return new String[0]; } String messages[]= result.getErrorMessages(); if (messages.length > 0) { return messages; } DebugException exception= result.getException(); if (exception != null ) { Throwable cause= exception.getStatus().getException(); if (cause instanceof InvocationException) { String nestedMessage= ((InvocationException) cause).exception().referenceType().name(); return new String[] { MessageFormat.format(DisplayMessages.JavaInspectExpression_0, new String[] {nestedMessage}) }; } return new String[] { exception.getMessage() }; } return new String[0]; } }
alertMessage= DebugUIMessages.JDIDebugUIPlugin_3; } else { status = new Status(IStatus.WARNING, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.WARNING, exception.getMessage(), exception.getCause()); preference= IJDIPreferencesConstants.PREF_ALERT_HCR_FAILED; alertMessage= DebugUIMessages.JDIDebugUIPlugin_1;
@Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof IScriptVariable) { IScriptVariable variable = (IScriptVariable) element; try { return !((IScriptValue) variable.getValue()).getType().getName().equals("function"); } catch (DebugException e) { if (DLTKCore.DEBUG) { e.printStackTrace(); } } } return true; } }
/** * @return a expression result with the given error text */ public static IWatchExpressionResult exception(String expression, DebugException exception) { WatchExpressionResult result = new WatchExpressionResult(expression); result.errors = Collections.singletonList(exception.toString()); result.exception = exception; return result; }
@Override public boolean visit(MethodDeclaration node) { try { // TODO: improve the comparison of the method which is visited and the debug // frame inFrame = (node.getName().toString().equals(fFrame.getMethodName())); } catch (DebugException e) { e.printStackTrace(); } return super.visit(node); }
@Override public void clearState(ThreadReference thread) { if (debugTarget != null) { synchronized (threadMap) { JDIThread jdiThread = threadMap.get(thread); if (jdiThread != null) { try { jdiThread.terminateEvaluation(); } catch (DebugException e) { logger.warning(String.format("Error stopping evaluation on thread %d: %s", thread.uniqueID(), e.toString())); } threadMap.remove(thread); } } } }
@Override public void setValue(IValue value) throws DebugException { throw new DebugException(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "Value modification not supported for indexed partitions.", null)); //$NON-NLS-1$ }
@Override public IStatus runInUIThread(IProgressMonitor monitor) { try { rendering.goToAddress(address); } catch (DebugException e) { if (getTableViewer() != null) getTableViewer().handlePresentationFailure(null, e.getStatus()); } return Status.OK_STATUS; }}; job.setSystem(true);
@Override protected IStatus run(IProgressMonitor monitor) { if (fIsDisposed) { return Status.OK_STATUS; } try { fContentDescriptor.updateContentBaseAddress(); } catch (DebugException e) { showMessage(e.getMessage()); } return Status.OK_STATUS; } };
@Override public void setValue(String expression) throws DebugException { throw new DebugException(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "Value modification not supported for indexed partitions.", null)); //$NON-NLS-1$ }
public void breakpointHasRuntimeException(final IJavaLineBreakpoint breakpoint, final DebugException exception) { IStatus status; Throwable wrappedException= exception.getStatus().getException(); if (wrappedException instanceof InvocationException) { InvocationException ie= (InvocationException) wrappedException; ObjectReference ref= ie.exception(); status= new Status(IStatus.ERROR,JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, ref.referenceType().name(), null); } else { status= exception.getStatus(); } openConditionErrorDialog(breakpoint, DebugUIMessages.JavaDebugOptionsManager_Conditional_breakpoint_encountered_runtime_exception__1, status); }
valueString = value.getValueString(); } catch (DebugException e){ valueString = e.getMessage();
/** * Create a new DebugException wrapping the given Throwable. * * @param exception * @return */ protected DebugException createDebugException(Throwable exception) { if (exception instanceof DebugException) { return (DebugException) exception; } else { return new DebugException(new Status( IStatus.ERROR, SDBGDebugCorePlugin.PLUGIN_ID, exception.getMessage(), exception)); } }
@Override protected IStatus run(IProgressMonitor jobMonitor) { if (!jobMonitor.isCanceled()) { fTarget.breakpointAdded(fBreakpoint); try { fResumee.resume(); } catch (DebugException e) { cancel(); return e.getStatus(); } } return Status.OK_STATUS; } };
/** * Displays an error message for the given exception. * * @param e exception to display */ public void displayError(DebugException e) { StyledText styleText = null; fIsShowingErrorPage = true; styleText = fTextViewer.getTextWidget(); if (styleText != null) { styleText.setText(DebugUIMessages.AbstractTableRendering_3 + e.getMessage()); } fPageBook.showPage(fTextViewer.getControl()); // clear content cache if we need to display error fContentProvider.clearContentCache(); }
/** * Throws a debug exception with a status code of <code>NOT_SUPPORTED</code>. * * @param message exception message * @param e underlying exception or <code>null</code> * @throws DebugException if a problem is encountered */ protected void notSupported(String message, Throwable e) throws DebugException { throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.NOT_SUPPORTED, message, e)); } }