Squirrel

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

print() does not output to console in SqDbg/SqDev

Last post 05-17-2008, 3:48 AM by danien. 2 replies.
Sort Posts: Previous Next
  •  11-12-2006, 12:38 PM 1401

    print() does not output to console in SqDbg/SqDev

    Using the eclipse setup, when I do a print, it will only show up in the console after the runtime is resumed, meaning when stepping through the program and doing print statements, the console shows nothing.

    is this a bug? i hope so because i often use the console during debugging and if i can't see output while the app is suspended, it defeats the purpose.
  •  11-15-2006, 10:36 AM 1421 in reply to 1401

    Re: print() does not output to console in SqDbg/SqDev

    Heh, I really must try out the debugger one of these days. I imagine this is a relatively easy fix.
  •  05-17-2008, 3:48 AM 2517 in reply to 1401

    Re: print() does not output to console in SqDbg/SqDev

    Flushing stdout in the print function that SQDBG registers with Squirrel seemed to work for me.

    In SQDBG, main.cpp:

    void printfunc(HSQUIRRELVM v,const SQChar *s,...)
    {
        va_list vl;
        va_start(vl, s);
        scvprintf( s, vl);
        va_end(vl);
        // Flush stdout to force output when stepping in debugger.
        fflush(stdout);
    }


View as RSS news feed in XML
Powered by Community Server, by Telligent Systems