The latest versions of OL now attach native stack traces to errors (when 
available from the runtime, e.g., when you are running the Flash Debug player). 
 This can be helpful when the OL backtrace is not accurate enough (the OL 
backtrace is only accurate to the nearest function call -- if you get an error 
trying to dereference null, the OL line number may not pinpoint the erring 
line).  Here's how to get a more accurate line number:

Lets say you get an error like:

> ERROR @debugger/LzDebug.lzs≈706: TypeError: Error #1010: A term is undefined 
> and has no properties. 

If inspecting the Error message (the red part) does not give you a good enough 
location (note how the line number is indicated with `≈` which is the 
debugger's way of telling you it is only giving you an approximate line 
number), then instead, inspect the actual error object (the blue part):

> lzx> Debug.inspect(«TypeError| TypeError: Error #1010: A term is…») 
> «TypeError#3| TypeError: Error #1010: A term is undefined and has no 
> properties.» { 
>  backtrace: «string(2027)| 'TypeError: Error #1010: A term is undefined and 
> has no properties.\n\tat LzDebugService/explainStyleBindingsI…» 
>  message: 'Error #1010: A term is undefined and has no properties.' 
>  name: 'TypeError' 
> } 

You'll see that it has its own backtrace, which, when inspected will give you 
the native stack trace and the actual line numbers in the intermediate files 
compiled by the flex compiler:

> lzx> Debug.inspect(«string(2027)| 'TypeError: Error #1010: A ter…») 
> TypeError: Error #1010: A term is undefined and has no properties. 
>       at 
> LzDebugService/explainStyleBindingsInternal()[/private/var/folders/4C/4C5C5+lq2RWP+U+8ZLnNq++++TQ/-Tmp-/lzswf9/lzgen8957545466024023728/LzDebugService.as:854]
>  
>       at 
> LzDebugService/explainStyleBindings()[/private/var/folders/4C/4C5C5+lq2RWP+U+8ZLnNq++++TQ/-
[...]

If you open this intermediate file, and go to the line number, that will 
usually be enough.  If you're still stumped, there are comments in the file

> /* -*- file: debugger/LzDebug.lzs#693 -*- */


that indicate the source line numbers.  (You may have to count lines from the 
nearest comment -- they are only emitted when the output line skews from the 
source line).  Similarly, the file name is only emitted when it changes, so you 
may have to scan backwards for a comment with the file specified:

> /* -*- file: #711 -*- */



Reply via email to