Re: Extend debug.getlocal() to get varargs.

  • From: Scott Lembcke <slembcke@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 19 Sep 2012 09:34:51 -0500

Awesome! Thanks Mike. :)

If anyone is interested, it's a simple CLI debugger that's just a single file 
to drop into your project. I started it because it sounded potentially fun, but 
it's actually pretty functional now. Does all the basic functions I wanted: 
step, next, continue, finish, print/eval, up, down, trace. Getting the 
environment correct for the print command was tricky, but I think it should 
always give you the correct local / upvalue / global value based on the scope. 
Now it can do vararg expressions in LuaJIT easily too. \o/

https://github.com/slembcke/debugger.lua

On Sep 19, 2012, at 5:21 AM, Mike Pall wrote:

> Scott Lembcke wrote:
>> Lua 5.2 extended debug.getlocal() with the ability to get vararg
>> parameters using negative indices.
> 
> I've just added this extension to LuaJIT git HEAD.
> 
> Ditto for the change in Lua 5.2 where debug.getlocal() accepts a
> Lua function instead of a level and returns the parameter names.
> On the C side this corresponds to lua_getlocal(L, NULL, n) with
> the Lua function on top of the Lua stack.
> 
> --Mike
> 


Other related posts: