[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: LuaInterface & threads
- From: "steffenj" <steffenj@...>
- Date: Sat, 20 Aug 2005 18:25:58 +0200
I intend to write a Lua debugger in C# via LuaInterface. I don't see the
debug facility exposed to C# programs, is this correct?
Currently, i'm trying to debug by using debug.sethook from within the lua
script. When the hook (a lua function) gets called, i want to suspend the
thread that does the lua.DoString("...") call, the thread is created like
luaThread = new Thread(new ThreadStart(LuaDoStringThread));
But when i do
luaThread:Suspend() -- in lua's hook function
(note that luaThread.Suspend() raises a "invalid arguments to method call"
luaThread.Resume() -- in C#
i get an exception that the thread hasn't been suspended manually or so.
I also looked into luaThread.Sleep() but oddly, in Lua this method is a
table with the following member:
[".fqn"] = value;
Correspondingly, when i try to call it, all i get is the exception:
[string "chunk"]:23: No such type: value
So far, i can only slow down the script by adding a "for" loop in the hook
function. The textbox i write to is correctly updated, so i can see what
happens when the script runs. But i want to be able to actually set a
breakpoint and suspend the script, while inspecting variables, call stack,
etc. How would i go about this?
I would appreciate any help or hints!