use of com.ericsson.otp.erlang.OtpErlangAtom in project erlide_eclipse by erlang.
the class ErlangDebugTarget method addNodesAsDebugTargets.
private void addNodesAsDebugTargets(final ILaunch aLaunch) {
final OtpErlangList nodes = ErlideDebug.nodes(backend.getOtpRpc());
if (nodes != null) {
for (int i = 1, n = nodes.arity(); i < n; ++i) {
final OtpErlangAtom a = (OtpErlangAtom) nodes.elementAt(i);
final IDebugTarget edn = new ErlangDebugNode(this, a.atomValue());
aLaunch.addDebugTarget(edn);
}
}
}
use of com.ericsson.otp.erlang.OtpErlangAtom in project erlide_eclipse by erlang.
the class ErlangDebugTarget method distributeDebuggerCode.
private void distributeDebuggerCode() {
final List<String> debuggerModules = getDebuggerModules();
final List<OtpErlangTuple> modules = new ArrayList<>(debuggerModules.size());
final String ver = backend.getRuntime().getVersion().asMajor().toString().toLowerCase();
for (final String module : debuggerModules) {
final OtpErlangBinary b = getDebuggerBeam(module, "org.erlide.kernel");
if (b != null) {
final OtpErlangString filename = new OtpErlangString(module + ".erl");
final OtpErlangTuple t = OtpErlang.mkTuple(new OtpErlangAtom(module), filename, b);
modules.add(t);
} else {
ErlLogger.warn("Could not find debugger module %s (%s)", module, ver);
}
}
ErlideDebug.distributeDebuggerCode(backend.getOtpRpc(), modules);
}
use of com.ericsson.otp.erlang.OtpErlangAtom in project erlide_eclipse by erlang.
the class ErlideDebug method interpret.
@SuppressWarnings("boxing")
public static boolean interpret(final IOtpRpc backend, final String moduleName, final OtpErlangList options, final boolean distributed, final boolean interpret) {
try {
final OtpErlangObject res = backend.call(ErlideDebug.ERLIDE_DEBUG, "interpret", "alxoo", moduleName, options, distributed, interpret);
if (res instanceof OtpErlangTuple) {
final OtpErlangTuple t = (OtpErlangTuple) res;
final OtpErlangObject o = t.elementAt(0);
if (o instanceof OtpErlangAtom) {
final OtpErlangAtom moduleAtom = (OtpErlangAtom) o;
return "module".equals(moduleAtom.atomValue());
}
}
return Util.isOk(res);
} catch (final RpcException e) {
ErlLogger.warn(e);
}
return false;
}
use of com.ericsson.otp.erlang.OtpErlangAtom in project erlide_eclipse by erlang.
the class ErlideDebug method isErlideProcess.
public static boolean isErlideProcess(final IOtpRpc backend, final OtpErlangPid pid) {
boolean res = false;
try {
final OtpErlangAtom eres = (OtpErlangAtom) backend.call(ErlideDebug.ERLIDE_DEBUG, "is_erlide_process", "p", pid);
res = Boolean.parseBoolean(eres.atomValue());
} catch (final Exception e) {
}
return res;
}
use of com.ericsson.otp.erlang.OtpErlangAtom in project erlide_eclipse by erlang.
the class ErlideDebug method getAllModulesOnStack.
public static List<String> getAllModulesOnStack(final IOtpRpc backend, final OtpErlangPid meta) {
try {
final OtpErlangObject res = backend.call(ErlideDebug.ERLIDE_DEBUG, "all_modules_on_stack", "x", meta);
if (res instanceof OtpErlangList) {
final OtpErlangList modules = (OtpErlangList) res;
final List<String> result = new ArrayList<>(modules.arity());
for (final OtpErlangObject module : modules) {
final OtpErlangAtom moduleA = (OtpErlangAtom) module;
result.add(moduleA.atomValue());
}
return result;
}
} catch (final RpcException e) {
ErlLogger.warn(e);
ErlLogger.error(e);
}
return null;
}
Aggregations