lua-users home
lua-l archive

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


Hi

How would one go about to make a debugger which works on coroutines in Lua?

I am completely new to Lua, but pretty OK at C. I wanted to make a simple debugger for Cocoa (MacOS X), so that if you make a program which executes custom lua scripts, those scripts can be debugged with a debugger inside the program (rather than using an external IDE). I'm not writing the debugger in lua, but in Objective-C (just think of it as C), and it's supposed to be called from C, not from Lua. I have used the documentation found here:

http://www.lua.org/manual/5.1/manual.html#3.8

It is Lua 5.1 I'm using. The debugger works fine, but when a coroutine is called, the debugger can't step through the lines in the function that the coroutine calls/executes. When my hooks are called, all the information I get is that I'm inside a C function called "resume". Is it feasible to do what I'm trying to do? Do I have to write some code inside the Lua environment to make it work? Currently it's all pure C/Objective-C, not even callable from Lua.

I'm also waiting for the newest copy of Programming In Lua in the mail. If the answer is in that book, I'm sorry... :)

Per