I'm trying to debug an script that seems to enter an infinite loop and one way that I'm experimenting to find out is to set a debughook and raise an exception after ncalls have been done to see the stack trace to help figure out what's the problem, but throwing an exception inside the debughook does nothing, looking through the code I found that it's because the debughook is called with raiseerror set to false.
There is any reason for that ?
I changed the raiseerror to true and now I can get the stack trace, although the program do not stop but it's ok while debuging.
local call_count = 0;
local function myDebugHook(event_type,sourcefile,line,funcname)
{
//print(call_count);
if((++call_count % 5000000) == 0) throw("too many calls " + call_count);
}
setdebughook(myDebugHook);
enabledebuginfo(true); //to get line by line
I'm trying to debug an script that seems to enter an infinite loop and one way that I'm experimenting to find out is to set a debughook and raise an exception after ncalls have been done to see the stack trace to help figure out what's the problem, but throwing an exception inside the debughook does nothing, looking through the code I found that it's because the debughook is called with
raiseerror
set to false.There is any reason for that ?
I changed the
raiseerror
to true and now I can get the stack trace, although the program do not stop but it's ok while debuging.