This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: NullPointerException / threads


> 
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]