Re: Meta Information for Debugging
- Posted by ghaberek (admin) Dec 19, 2014
- 1278 views
Is there line counting problem in here somewhere? Perhaps an off-by-one error? Or maybe I'm misunderstanding how call_stack() reports its line numbers?
/* 1 */ /* 2 */ without inline /* 3 */ include euphoria/debug/debug.e /* 4 */ include std/console.e /* 5 */ /* 6 */ sequence cs = call_stack() /* 7 */ display( cs[2..$] ) /* 8 */
{ "<TopLevel>", "C:\\Temp\\debug.ex", 5 <-- call_stack() was called from line 6 }
/* 1 */ /* 2 */ without inline /* 3 */ include euphoria/debug/debug.e /* 4 */ include std/console.e /* 5 */ /* 6 */ procedure debug_print() /* 7 */ sequence cs = call_stack() /* 8 */ display( cs[2..$] ) /* 9 */ end procedure /* 10 */ /* 11 */ debug_print() /* 12 */
{ { "debug_print", "C:\\Temp\\debug.ex", 6 <-- call_stack() was called from line 7 }, { "<TopLevel>", "C:\\Temp\\debug.ex", 10 <-- debug_print() was called from line 11 } }
-Greg