A really difficult question !

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

A really difficult question !

Christophe Gimenez
Hello,

is there a way to execute some code step by step ?

here is an example (no matter the syntax):

function Foo()
{
	while Ok do
	{
		Call_CFunction1();
		if (t==3) then
			Call_CFunction2();
		Call_CFunction3();
	}
}

I would like this LUA code to be execute like that :

- everytime LUA doesn't handle an external C function (from my OWN lib, not 
standard LUA lib) execution goes normally
- everytime LUA call a C_Function() : LUA state is frozen. LUA code stop 
running. Next time I need LUA code goes to the next statement after the 
C_Function() call .

For short : all LUA code run normal except my C_Function Calls.

Is this possible ?

Reply | Threaded
Open this post in threaded view
|

Re: A really difficult question !

Erik Hougaard
Christophe Gimenez wrote:
> For short : all LUA code run normal except my C_Function Calls.
> 
> Is this possible ?

Yes, You need to make yourself a simple debugger be using the
lua_callhook this function is called everytime Lua calls a function ..
In that you should be able to identify your function and do what you
need to do!

/Erik