private final OtpErlangPid myActivePid;
private final List<ErlangProcessSnapshot> mySnapshots;
public BreakpointReachedEvent(OtpErlangTuple breakpointReachedMessage) throws DebuggerEventFormatException {
OtpErlangPid activePid = getPidValue(elementAt(breakpointReachedMessage, 1));
OtpErlangList snapshots = getListValue(elementAt(breakpointReachedMessage, 2));
if (activePid == null || snapshots == null) throw new DebuggerEventFormatException();
myActivePid = activePid;
mySnapshots = new ArrayList<ErlangProcessSnapshot>(snapshots.arity());
for (OtpErlangObject snapshot : snapshots) {
OtpErlangTuple snapshotTuple = getTupleValue(snapshot); // {Pid, Function, Status, Info, Stack}
OtpErlangPid pid = getPidValue(elementAt(snapshotTuple, 0));
ErlangTraceElement init = getTraceElement(getTupleValue(elementAt(snapshotTuple, 1)), null);
String status = getAtomText(elementAt(snapshotTuple, 2));
OtpErlangObject info = elementAt(snapshotTuple, 3);
List<ErlangTraceElement> stack = getStack(getListValue(elementAt(snapshotTuple, 4)));