another feature request

Matthew Fluet fluet@CS.Cornell.EDU
Wed, 19 Sep 2001 17:47:31 -0400 (EDT)


> I don't know if this is a plausible thing to ask mlton for (depends on your
> implementation model), but is there a way to do a stack trace for an uncaught
> exception?  (What in NJ you get from SMLofNJ.exnHistory)

Right now, upon raising an exception, control jumps right to the handler,
skipping over any intervening frames.  It doesn't seem impossible to
extract the stack info, but the best we might be able to do would be to
produce the list of return continuations on the stack.  These could be
mapped back to CPS functions (i.e., functions in an IL), but they wouldn't
necessarily correspond to source functions.  Various optimizations
(including contification ;) are going to move source functions around.
With a little effort and inspection of the CPS IL program, you can
generally figure out what source function corresponds to portions of the
program (we've been fairly successful at this looking at the profiler
output).