Squirrel

The programming language
Welcome to Squirrel Sign in | Join | Help
in Search

squirrel coroutine debugging( Sqdev, Sqdbg )

Last post 05-28-2008, 1:10 PM by Capyvara. 2 replies.
Sort Posts: Previous Next
  •  12-28-2007, 1:59 AM 2322

    squirrel coroutine debugging( Sqdev, Sqdbg )

    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 );

                 }

    }

     

  •  12-28-2007, 5:12 AM 2323 in reply to 2322

    Re: squirrel coroutine debugging( Sqdev, Sqdbg )

    Hi, I wrote a coroutine-aware version of sqdbg, I never made it public. Currently I'm in holiday in Italy so I do not have it with me. When I'll go back home, I'll put it on the wiki; In about 2 weeks.

    ciao

    Alberto

  •  05-28-2008, 1:10 PM 2546 in reply to 2323

    Re: squirrel coroutine debugging( Sqdev, Sqdbg )

    Bump.

    The wiki sqdbg version is from oct 2005, did you posted it? I really need it. :)

    Also, is SQDev source code available?
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems