This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: NullPointerException / threads
- To: tromey at cygnus dot com (Tom Tromey)
- Subject: Re: NullPointerException / threads
- From: Godmar Back <gback at cs dot utah dot edu>
- Date: Tue, 14 Mar 2000 11:21:32 -0700 (MST)
- Cc: aph at pasanda dot cygnus dot co dot uk (Andrew Haley), java-discuss at sourceware dot cygnus dot com
>
> Some VMs create the stack trace lazily. I don't know how they do
> this. Could we do it somehow?
>
My understanding is that the stacktrace is associated with the
exception object, not the throw site. In other words, an exception
can be created in a callee, returned to and thrown by a caller, and the
stacktrace would have to include the callee's frame.
What we've implemented in kaffe is the following: the stacktrace is filled
in when the exception is created; but it's only an array of pc/fp pairs.
What is done lazily (only when the exception is dispatched or when someone
tries to print the backtrace), however, is mapping the pc to the corresponding
method to extract its name/line numbers for printing or exception handlers
for dispatch.
I don't know if that's what you mean by "lazily", but I'd be interested in
learning how you could do it even more lazily.
- Godmar