On Wed, Dec 9, 2009 at 11:39 AM, Attila Szegedi <[email protected]> wrote: > On 2009.11.30., at 18:21, Charles Oliver Nutter wrote: > >> Yes, blasted stack traces...they are a pain to cope with for sure. >> JRuby and Jython are probably the only two widely-used JVM languages >> that present *nice* stack traces > > Rhino, in interpreted mode, will inject script stack elements into the Java > stack elements, so above every org.mozilla.javascript.Interpreter.interpret() > element, you'll have all the JS frames the interpreter created, with an > appropriate syntax (function name + source code name + line number; obviously > the class name doesn't apply...).
I'm not sure I'd call that *nice* but it does at least include information you would otherwise be missing. A couple of JRuby's stacktrace modes will do the same thing, but in our case we actually omit the interpreter frames in place of the actual code's frames. I don't want to complicate the potential RFE too much, but there's actually two cases we need to support: * Being able to omit elements from the backtraces * Being able to add or replace elements in the backtrace Both of these currently require either post-processing (slow) or artificial call stacks (slow). We have modes using both techniques in JRuby, and it's frustrating for us that our desire to produce nice stack traces for our users means we're often slower (in default modes) than other JVM dynlangs. With that stuff turned off, we're very nearly the fastest dynlang. So yes, we would love to see a lighter-weight way to help the JVM produce "nice" stack traces. Is there a debugger hook we might be able to use in some situations? I know the automatic argument against that would be "nobody will run debug mode in production", but the counter to that is "nobody will run Java 7 + nice-stacktrace-support in production either." Something that *works* in the short term could help bootstrap a future JSR or RFE, even if it's based on debug mode that most folks won't use. - Charlie -- You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en.
