Search in sources :

Example 11 with IDebugTarget

use of org.eclipse.debug.core.model.IDebugTarget in project statecharts by Yakindu.

the class HighlightingSubmachineDecorationProvider method debugContextChanged.

public void debugContextChanged(DebugContextEvent event) {
    if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
        PlatformObject object = (PlatformObject) ((IStructuredSelection) event.getContext()).getFirstElement();
        if (object == null)
            return;
        IDebugTarget newTarget = (IDebugTarget) object.getAdapter(IDebugTarget.class);
        if (newTarget != debugTarget && newTarget != null && !newTarget.isTerminated()) {
            debugTarget = newTarget;
        }
    }
}
Also used : IDebugTarget(org.eclipse.debug.core.model.IDebugTarget) PlatformObject(org.eclipse.core.runtime.PlatformObject)

Example 12 with IDebugTarget

use of org.eclipse.debug.core.model.IDebugTarget in project webtools.sourceediting by eclipse.

the class ResultView method createPartControl.

@Override
public void createPartControl(Composite parent) {
    this.sv = createViewer(parent);
    // handle any launches already added
    IDebugTarget[] targets = DebugPlugin.getDefault().getLaunchManager().getDebugTargets();
    for (IDebugTarget debugTarget : targets) {
        if (debugTarget instanceof JAXPDebugTarget) {
            handleDebugTarget((JAXPDebugTarget) debugTarget);
        }
    }
    // listen to further launches
    DebugPlugin.getDefault().addDebugEventListener(this);
}
Also used : JAXPDebugTarget(org.eclipse.wst.xsl.jaxp.launching.model.JAXPDebugTarget) IDebugTarget(org.eclipse.debug.core.model.IDebugTarget)

Example 13 with IDebugTarget

use of org.eclipse.debug.core.model.IDebugTarget in project sling by apache.

the class JVMDebuggerConnection method stop.

public void stop(boolean force) {
    IProcess[] processes = launch.getProcesses();
    if (processes != null) {
        for (int i = 0; i < processes.length; i++) {
            IProcess iProcess = processes[i];
            try {
                iProcess.terminate();
            } catch (DebugException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }
    IDebugTarget[] debugTargets = launch.getDebugTargets();
    if (debugTargets != null) {
        for (int i = 0; i < debugTargets.length; i++) {
            IDebugTarget iDebugTarget = debugTargets[i];
            try {
                iDebugTarget.disconnect();
            } catch (DebugException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }
    IDebugTarget dt = launch.getDebugTarget();
    if (dt != null) {
        try {
            dt.disconnect();
        } catch (DebugException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
Also used : IDebugTarget(org.eclipse.debug.core.model.IDebugTarget) DebugException(org.eclipse.debug.core.DebugException) IProcess(org.eclipse.debug.core.model.IProcess)

Example 14 with IDebugTarget

use of org.eclipse.debug.core.model.IDebugTarget in project erlide_eclipse by erlang.

the class DebugTraceAsLaunchAction method selectionChanged.

@Override
public void selectionChanged(final IAction action, final ISelection selection) {
    fTarget = null;
    if (selection instanceof IStructuredSelection) {
        final IStructuredSelection ss = (IStructuredSelection) selection;
        for (final Object o : ss.toArray()) {
            if (o instanceof IDebugTarget) {
                final IDebugTarget target = (IDebugTarget) o;
                fTarget = target;
                break;
            }
        }
    }
}
Also used : IDebugTarget(org.eclipse.debug.core.model.IDebugTarget) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 15 with IDebugTarget

use of org.eclipse.debug.core.model.IDebugTarget in project erlide_eclipse by erlang.

the class ErlangProcess method setStackFrames.

public void setStackFrames(final String module, final int line, final OtpErlangList erlStackFrames, final OtpErlangList bs) {
    stackFrames = new ArrayList<>();
    final IDebugTarget target = getDebugTarget();
    stackFrames.add(new ErlangStackFrame(module, this, target, line, null, bs, erlStackFrames.arity() + 2));
    for (final OtpErlangObject o : erlStackFrames) {
        final OtpErlangTuple t = (OtpErlangTuple) o;
        final OtpErlangTuple mfa;
        final OtpErlangObject el0 = t.elementAt(0);
        final OtpErlangObject el1 = t.elementAt(1);
        if (el0 instanceof OtpErlangTuple) {
            mfa = (OtpErlangTuple) el0;
        } else if (el1 instanceof OtpErlangTuple) {
            mfa = (OtpErlangTuple) el1;
        } else {
            mfa = t;
        }
        int stackFrameNo;
        final OtpErlangObject mfa0 = mfa.elementAt(0);
        if (!(mfa0 instanceof OtpErlangAtom)) {
            ErlLogger.debug("%s", mfa0);
        }
        final OtpErlangAtom m = (OtpErlangAtom) mfa0;
        final OtpErlangLong l = (OtpErlangLong) t.elementAt(1);
        final OtpErlangList bindings = (OtpErlangList) t.elementAt(2);
        final OtpErlangLong n = (OtpErlangLong) t.elementAt(3);
        int lin;
        try {
            lin = l.intValue();
        } catch (final OtpErlangRangeException e) {
            lin = -1;
        }
        final String mod = m.atomValue();
        try {
            stackFrameNo = n.intValue();
        } catch (final OtpErlangRangeException e) {
            stackFrameNo = -1;
        }
        stackFrames.add(new ErlangStackFrame(mod, this, target, lin, null, bindings, stackFrameNo));
    }
}
Also used : OtpErlangLong(com.ericsson.otp.erlang.OtpErlangLong) OtpErlangList(com.ericsson.otp.erlang.OtpErlangList) OtpErlangObject(com.ericsson.otp.erlang.OtpErlangObject) IDebugTarget(org.eclipse.debug.core.model.IDebugTarget) OtpErlangRangeException(com.ericsson.otp.erlang.OtpErlangRangeException) OtpErlangTuple(com.ericsson.otp.erlang.OtpErlangTuple) OtpErlangAtom(com.ericsson.otp.erlang.OtpErlangAtom) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) ErlangLineBreakpoint(org.erlide.backend.debug.ErlangLineBreakpoint)

Aggregations

IDebugTarget (org.eclipse.debug.core.model.IDebugTarget)23 DebugException (org.eclipse.debug.core.DebugException)4 ILaunch (org.eclipse.debug.core.ILaunch)4 EObject (org.eclipse.emf.ecore.EObject)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 IErlangDebugNode (org.erlide.backend.debug.IErlangDebugNode)3 OtpErlangAtom (com.ericsson.otp.erlang.OtpErlangAtom)2 OtpErlangList (com.ericsson.otp.erlang.OtpErlangList)2 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)2 PlatformObject (org.eclipse.core.runtime.PlatformObject)2 IBreakpoint (org.eclipse.debug.core.model.IBreakpoint)2 IProcess (org.eclipse.debug.core.model.IProcess)2 IJavaDebugTarget (org.eclipse.jdt.debug.core.IJavaDebugTarget)2 IVMConnector (org.eclipse.jdt.launching.IVMConnector)2 JAXPDebugTarget (org.eclipse.wst.xsl.jaxp.launching.model.JAXPDebugTarget)2 ErlangLineBreakpoint (org.erlide.backend.debug.ErlangLineBreakpoint)2 OtpErlangLong (com.ericsson.otp.erlang.OtpErlangLong)1 OtpErlangObject (com.ericsson.otp.erlang.OtpErlangObject)1