Package org.erlide.util.erlang

Examples of org.erlide.util.erlang.Bindings


public class DebuggerEventFactory {

    public static DebuggerEvent parse(final OtpErlangObject message) {
        // TODO More events from dbg_mon...
        try {
            Bindings b = OtpErlang.match("{started, Pid:p}", message);
            if (b != null) {
                return buildStartedEvent(b);
            }
            b = OtpErlang.match("{terminated, Pid:p}", message);
            if (b != null) {
View Full Code Here


        return parseMeta(b.getPid("Meta"), b.get("Event"));
    }

    private static MetaEvent parseMeta(final OtpErlangPid pid, final OtpErlangObject event) {
        try {
            Bindings b = OtpErlang.match("{break_at, Mod:a, Line:i, Crt}", event);
            if (b != null) {
                return new BreakAtEvent(pid, b.getAtom("Mod"), b.getInt("Line"),
                        b.get("Crt"));
            }
            b = OtpErlang.match("{exit_at, Pos, Reason, Le, OrigPid:p}", event);
            if (b != null) {
                return new ExitAtEvent(pid, b.get("Pos"), b.get("Reason"), b.get("Le"),
                        b.getPid("OrigPid"));
            }
            b = OtpErlang.match("{exit_at, Pos, Reason, Le, OrigPid:p, Stack:l, Binds:l}",
                    event);
            if (b != null) {
                return new ExitAtEvent(pid, b.get("Pos"), b.get("Reason"), b.get("Le"),
                        b.getPid("OrigPid"), (OtpErlangList) b.get("Stack"),
                        (OtpErlangList) b.get("Binds"));
            }
            b = OtpErlang.match("{wait_at, Mod:a, Line:i, Crt}", event);
            if (b != null) {
                return new WaitAtEvent(pid, b.getAtom("Mod"), b.getInt("Line"),
                        b.get("Crt"));
            }
        } catch (final Exception e) {
        }
        // this is a default event that does nothing
        return new MetaEvent(pid, event);
View Full Code Here

        }
    }

    private void addStackTrace(final OtpErlangTuple savedStackTrace) {
        try {
            final Bindings bind = OtpErlang.match("{saved_stacktrace, _,STrace}",
                    savedStackTrace);
            if (bind != null) {
                final Collection<OtpErlangObject> trace = bind.getList("STrace");
                for (final OtpErlangObject oframe : trace) {
                    final OtpErlangTuple frame = (OtpErlangTuple) oframe;
                    final OtpErlangAtom m = (OtpErlangAtom) frame.elementAt(0);
                    final OtpErlangAtom f = (OtpErlangAtom) frame.elementAt(1);
                    final OtpErlangLong a = (OtpErlangLong) frame.elementAt(2);
View Full Code Here

TOP

Related Classes of org.erlide.util.erlang.Bindings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.