|
|
On 7/25/2011 6:42, Warp wrote:
> But if the null pointer is accessed in the depths of some obscure system
> library which gets called by the main runloop of the program (rather than
> being directly called by your code), you might end up in a situation where
> the stack trace is completely unhelpful and you have no idea whatsoever
> where that null pointer is coming from in your code (which might happen if
> you are not using that precise system library directly, but it's a library
> used by a library used by a library which you are using, but you don't know
> what this chain might be, as the implementation of the library you are using
> is hidden behind its public interface).
The stack trace in something like Java or Tcl is as useful as a full stack
trace from gdb is in C, when you haven't actually clobbered memory in the
unsafe languages. I.e., you walk up the stack until you find your code that
invokes the not-your-code, then you figure out what happened from there.
With the more OO stuff, the problem is figuring out which object you're
talking about, IME. An interactive debugger that lets you examine things at
the object-graph level solves that problem for the most part.
--
Darren New, San Diego CA, USA (PST)
"Coding without comments is like
driving without turn signals."
Post a reply to this message
|
|