Changeset 13108 for trunk/abcl/src/org


Ignore:
Timestamp:
12/28/10 21:00:22 (11 years ago)
Author:
Mark Evenson
Message:

Fix strange backtrace growth as reported in ticket #114.

There may be other code paths through the error() routines that need
similar exceptions to omit their code paths as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Lisp.java

    r13028 r13108  
    332332      final StackTraceElement[] frames = thread.getJavaStackTrace();
    333333
     334      // frames[0] java.lang.Thread.getStackTrace
     335      // frames[1] org.armedbear.lisp.LispThread.getJavaStackTrace
     336      // frames[2] org.armedbear.lisp.Lisp.pushJavaStackFrames
     337
     338      if (frames.length > 5
     339        && frames[3].getClassName().equals("org.armedbear.lisp.Lisp")
     340        && frames[3].getMethodName().equals("error")
     341        && frames[4].getClassName().startsWith("org.armedbear.lisp.Lisp")
     342        && frames[4].getMethodName().equals("eval")) {
     343          // Error condition arising from within Lisp.eval(), so no
     344          // Java stack frames should be visible to the consumer of the stack abstraction
     345          return;
     346      }
    334347      // Search for last Primitive in the StackTrace; that was the
    335348      // last entry point from Lisp.
     
    339352            last = i;
    340353      }
    341       // Do not include the first three frames:
    342       //   Thread.getStackTrace, LispThread.getJavaStackTrace,
    343       //   Lisp.pushJavaStackFrames.
     354      // Do not include the first three frames which, as noted above, constitute
     355      // the invocation of this method.
    344356      while (last > 2) {
    345357        thread.pushStackFrame(new JavaStackFrame(frames[last]));
Note: See TracChangeset for help on using the changeset viewer.