lua-users home
lua-l archive

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


Hi Sean,

First thanks for mentioning that nifty debugger.
I've got it running under luajit osx (git commit 58f38c254bcdcf1f874f2e052751f568c2866133)

But I had to tweak the gl() function. I'm not sure whether I did the right thing:

I've found the code under "Updated" section in here:
http://luaforge.net/frs/?group_id=228

Direct Link to the code:
http://luaforge.net/frs/download.php/2498/debugger.lua

In the original gl() was defined like this:

local function gl( level, j )
  return function() j=j+1 return debug.getlocal( level, j ) end
end

And I've changed it to this:

local function gl( level, j )
   return function() j=j+1;
	     local ok, k, v = pcall(debug.getlocal(level, j))
	     if ok then return k,v end
	  end
end

And it works, at least putting pause() in my code after some iterations activated the debugger.

Thanks,
Dimiter "malkia" Stanev.

On 5/16/11 8:59 PM, Sean Dunn wrote:
I'm creating a GUI debugger for my application, using the CliDebugger as
a starting point. It seems that the lack of return hook support for
native calls is causing my stack levels to increase as I step through
scripts that call out to C functions. Are there any known workarounds
for this? I'd be willing to modify LuaJIT source if someone can point me
to what needs to be implemented, but I'm hoping for a Lua solution.

Sean