use of com.ericsson.otp.erlang.OtpErlangAtom in project erlide_eclipse by erlang.
the class IndexedErlangValue method checkRecord.
private IErlRecordDef checkRecord(final OtpErlangObject o) {
if (o instanceof OtpErlangTuple) {
final OtpErlangTuple t = (OtpErlangTuple) o;
final OtpErlangObject h = t.elementAt(0);
if (h instanceof OtpErlangAtom) {
final OtpErlangAtom a = (OtpErlangAtom) h;
final ErlangDebugTarget target = getErlangDebugTarget();
IErlPreprocessorDef pd;
try {
pd = ErlangEngine.getInstance().getModelFindService().findPreprocessorDef(getErlProjects(target.getProjects()), moduleName, a.atomValue(), ErlElementKind.RECORD_DEF);
if (pd instanceof IErlRecordDef) {
final IErlRecordDef r = (IErlRecordDef) pd;
if (r.hasChildren() && r.getChildCount() + 1 == t.arity()) {
return r;
}
}
} catch (final CoreException e) {
}
}
}
return null;
}
use of com.ericsson.otp.erlang.OtpErlangAtom 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 com.ericsson.otp.erlang.OtpErlangAtom 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 com.ericsson.otp.erlang.OtpErlangAtom in project erlide_eclipse by erlang.
the class NoInterpretEvent method execute.
@Override
public void execute(final ErlangDebugTarget debugTarget) {
final OtpErlangAtom m = (OtpErlangAtom) cmds[1];
debugTarget.getInterpretedModules().remove(m.atomValue());
debugTarget.fireEvent(new DebugEvent(this, DebugEvent.MODEL_SPECIFIC, ErlangDebugTarget.INTERPRETED_MODULES_CHANGED));
}
use of com.ericsson.otp.erlang.OtpErlangAtom in project erlide_eclipse by erlang.
the class ErlangDebugTarget method terminate.
@Override
public void terminate() throws DebugException {
if (terminated) {
return;
}
terminated = true;
if (backend != null) {
if (backend.getOtpRpc() != null) {
backend.getOtpRpc().send("dbg_mon", new OtpErlangAtom("stop"));
}
final DebugPlugin dbgPlugin = DebugPlugin.getDefault();
if (dbgPlugin != null) {
dbgPlugin.getBreakpointManager().removeBreakpointListener(this);
}
if (debuggerDaemon != null) {
debuggerDaemon.stop();
}
backend.dispose();
}
if (launch != null) {
launch.terminate();
}
fireTerminateEvent();
}
Aggregations