Hello, I’m writing some code related to squirrel debugging.
Normal code can be debugged under Eclipse well but with thread it doesn’t seem to work. In detail, the problem is that there is a breakpoint in the source code which run on new thread. In that case, Eclipse can’t grab the process. I don’t know why.
If there is anyone who experience this problem already, please tell me how I can solve it.
Thank you.
This is normal sqdbg sample code. It can be debugged in Eclipse well.
HSQUIRRELVM v = sq_open(1024);
HSQREMOTEDBG rdbg = sq_rdbg_init(v,1234,SQTrue);
sq_enabledebuginfo(v,SQTrue);
sq_setprintfunc(v,printfunc);
if(SQ_SUCCEEDED(sq_rdbg_waitforconnections(rdbg)))
{
scprintf(_SC("connected\n"));
sq_pushroottable(v);
sqstd_register_bloblib(v);
sqstd_register_iolib(v);
sqstd_seterrorhandlers(v);
//!!EXECUTE A SCTIPT
if( SQ_FAILED( sqstd_dofile( v , "C:\\Test2.nut", SQFalse, SQTrue ) ) )
{
PrintError( v );
}
}
Below, there is modified source code to run it on thread. As I told, the source code which run in thread can’t be debugged in Eclipse.
HSQUIRRELVM v = sq_open(1024);
HSQREMOTEDBG rdbg = sq_rdbg_init(v,1234,SQTrue);
sq_enabledebuginfo(v,SQTrue);
sq_setprintfunc(v,printfunc);
if(SQ_SUCCEEDED(sq_rdbg_waitforconnections(rdbg)))
{
scprintf(_SC("connected\n"));
sq_pushroottable(v);
sqstd_register_bloblib(v);
sqstd_register_iolib(v);
sqstd_seterrorhandlers(v);
//!!EXECUTE A SCTIPT
//here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
HSQUIRRELVM tv = sq_newthread(v, 1024); //modify
if( SQ_FAILED( sqstd_dofile( tv , "C:\\Test2.nut", SQFalse, SQTrue ) ) ) //modify
{
PrintError( v );
}
}