Permalink
Browse files

Very crude stack trace support for interpreted mode. Prevents some er…

…rors, though.

(E.g. for "erlang:halt()" in interpreted mode.)
  • Loading branch information...
1 parent 75fe296 commit f8e666e99bfcf68673ca237de9783ff8946072c9 @esstrifork esstrifork committed Jan 27, 2014
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/main/java/erjang/ErlangException.java
@@ -247,6 +247,18 @@ private static ETuple4 decodeTraceElem(StackTraceElement st) {
mname.equals("invoke"))
return null;
+ if (mname.equals("interpret") &&
+ cname.equals("erjang.beam.interpreter.Interpreter$Module$Function"))
+ {
+ ETuple4 res = new ETuple4();
+ res.elem1 = EAtom.intern("<interpreted>");
+ res.elem2 = EAtom.intern("<interpreted>");
+ res.elem3 = new ESmall(-1);
+ res.elem4 = EList.make(new ETuple2(am_file, new EString("<unknown>")),
+ new ETuple2(am_line, ERT.box(st.getLineNumber())));
+ return res;
+ }
+
Class<?> clazz = null;
try {
clazz = Class.forName(cname);

0 comments on commit f8e666e

Please sign in to comment.