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();
}
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);
}
}
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();
}
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());
}
}
}
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);
}
Aggregations