Search in sources :

Example 1 with ErlangProcess

use of org.erlide.backend.debug.model.ErlangProcess in project erlide_eclipse by erlang.

the class NewProcessEvent method execute.

@Override
public void execute(final ErlangDebugTarget debugTarget) {
    final OtpErlangTuple t = (OtpErlangTuple) cmds[1];
    final OtpErlangPid pid = (OtpErlangPid) t.elementAt(0);
    final ErlangProcess erlangProcess = debugTarget.getOrCreateErlangProcess(pid);
    final OtpErlangAtom statusA = (OtpErlangAtom) t.elementAt(2);
    final String status = statusA.atomValue();
    erlangProcess.setStatus(status);
    final OtpErlangTuple initialCall = (OtpErlangTuple) t.elementAt(1);
    erlangProcess.setInitialCall(new ErlangFunctionCall(initialCall));
    erlangProcess.fireCreationEvent();
}
Also used : OtpErlangPid(com.ericsson.otp.erlang.OtpErlangPid) ErlangFunctionCall(org.erlide.util.ErlangFunctionCall) ErlangProcess(org.erlide.backend.debug.model.ErlangProcess) OtpErlangTuple(com.ericsson.otp.erlang.OtpErlangTuple) OtpErlangAtom(com.ericsson.otp.erlang.OtpErlangAtom)

Example 2 with ErlangProcess

use of org.erlide.backend.debug.model.ErlangProcess in project erlide_eclipse by erlang.

the class NewStatusEvent method execute.

@Override
public void execute(final ErlangDebugTarget debugTarget) {
    final OtpErlangPid pid = (OtpErlangPid) cmds[1];
    final ErlangProcess erlangProcess = debugTarget.getOrCreateErlangProcess(pid);
    final OtpErlangAtom sa = (OtpErlangAtom) cmds[2];
    final String status = sa.atomValue();
    if ("break".equals(status)) {
        handleBreakStatus(erlangProcess, status);
    } else if ("exit".equals(status)) {
        handleExitStatus(erlangProcess, status);
    } else if ("running".equals(status)) {
        handleRunningStatus(erlangProcess, status);
    } else if ("idle".equals(status)) {
        handleIdleStatus(erlangProcess, status);
    } else {
        erlangProcess.setStatus(status);
        erlangProcess.fireChangeEvent(DebugEvent.STATE | DebugEvent.CHANGE);
    }
}
Also used : OtpErlangPid(com.ericsson.otp.erlang.OtpErlangPid) ErlangProcess(org.erlide.backend.debug.model.ErlangProcess) OtpErlangAtom(com.ericsson.otp.erlang.OtpErlangAtom)

Example 3 with ErlangProcess

use of org.erlide.backend.debug.model.ErlangProcess in project erlide_eclipse by erlang.

the class BreakAtEvent method execute.

@Override
public void execute(final ErlangDebugTarget debugTarget) {
    if (module == null || line == -1) {
        ErlLogger.debug("can't do anything with no module/line defined");
        return;
    }
    final ErlangProcess erlangProcess = debugTarget.getOrCreateErlangProcess(getPid(debugTarget));
    // FIXME can't get stack in wait...
    // should be possible according to dbg_ui_trace_win....
    erlangProcess.getStackAndBindings(module, line);
    if (erlangProcess.isStepping()) {
        erlangProcess.fireSuspendEvent(DebugEvent.STEP_END);
    } else {
        erlangProcess.fireSuspendEvent(DebugEvent.BREAKPOINT);
    }
    erlangProcess.setNotStepping();
}
Also used : ErlangProcess(org.erlide.backend.debug.model.ErlangProcess)

Example 4 with ErlangProcess

use of org.erlide.backend.debug.model.ErlangProcess in project erlide_eclipse by erlang.

the class ToggleDebugTracingAction method run.

@Override
public void run(final IAction action) {
    final IStructuredSelection ss = (IStructuredSelection) fSelection;
    for (final Object o : ss.toArray()) {
        if (o instanceof ErlangProcess) {
            final ErlangProcess p = (ErlangProcess) o;
            p.setTracing(!p.getTracing());
        }
    }
}
Also used : ErlangProcess(org.erlide.backend.debug.model.ErlangProcess) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 5 with ErlangProcess

use of org.erlide.backend.debug.model.ErlangProcess in project erlide_eclipse by erlang.

the class ExitAtEvent method execute.

@Override
public void execute(final ErlangDebugTarget debugTarget) {
    final ErlangProcess erlangProcess = debugTarget.getOrCreateErlangProcess(getPid(debugTarget));
    if (module == null || line == -1) {
        erlangProcess.removeStackFrames();
        erlangProcess.fireSuspendEvent(DebugEvent.TERMINATE);
    }
    if (stackFrames != null) {
        erlangProcess.setStackFrames(module, line, stackFrames, bindings);
    }
    erlangProcess.fireSuspendEvent(DebugEvent.TERMINATE);
}
Also used : ErlangProcess(org.erlide.backend.debug.model.ErlangProcess)

Aggregations

ErlangProcess (org.erlide.backend.debug.model.ErlangProcess)5 OtpErlangAtom (com.ericsson.otp.erlang.OtpErlangAtom)2 OtpErlangPid (com.ericsson.otp.erlang.OtpErlangPid)2 OtpErlangTuple (com.ericsson.otp.erlang.OtpErlangTuple)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 ErlangFunctionCall (org.erlide.util.ErlangFunctionCall)1