lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


If your debugger won't let you just execute arbitrary code while "broke",
but does let you change the Instruction pointer within the current function
<i.e. like MS VC>, it is a simple expedient to shove a call to a lua stack
dump function down below the return statement of each Lua enabled function.
Then you can change the instruction pointer down to this spot and dump the
current stack from "wherever".

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br]On Behalf Of Curt Carpenter
Sent: Thursday, September 04, 2003 12:00 PM
To: Lua list
Subject: RE: lua_call / lua_pcall inside a C Function - help!


Probably there is no global "add". There's no global "add", unless you
think you added it.

I find it useful to examine the state of the Lua stack while debugging.
Assuming you're using a debugger that lets you evaluate functions while
broke, you can have a static function to dump the Lua stack and call it
to verify your expectations step by step. Of course, even if your
debugger does not support function eval, you can just instrument your
code to dump the stack at interesting locations accordingly.

Curt

<<attachment: winmail.dat>>