Example #1
0
void CodeLiteLLDBApp::OpenCoreFile(const LLDBCommand& command)
{
    wxPrintf("codeite-lldb: debugging core file '%s'\n", command.GetCorefile());
    wxPrintf("codeite-lldb: executable file '%s'\n", command.GetExecutable());

    if(!InitializeLLDB(command)) {
        return;
    }

    lldb::SBProcess process = m_target.LoadCore(command.GetCorefile().mb_str(wxConvUTF8).data());
    if(!process.IsValid()) {
        wxPrintf("codeite-lldb: error loading core file '%s'\n", command.GetCorefile());
        NotifyExited();
        return;
    }

    // Launch the thread that will handle the LLDB process events
    m_lldbProcessEventThread =
        new LLDBProcessEventHandlerThread(this, m_debugger, m_target.GetProcess(), kDebugSessionTypeCore);
    m_lldbProcessEventThread->Start();

    // Notify codelite that the debugger started successfully
    NotifyStarted(kDebugSessionTypeCore);

    // In any case, reset the interrupt reason
    m_interruptReason = kInterruptReasonNone;

    // Since we are in 'core' session
    // immediately notify about 'stop'
    NotifyStopped();
}
Example #2
0
void CodeLiteLLDBApp::AcceptNewConnection() throw(clSocketException)
{
    m_replySocket.reset(NULL);
    wxPrintf("codelite-lldb: waiting for new connection\n");
    try {
        while(true) {
            m_replySocket = m_acceptSocket.WaitForNewConnection(1);
            if(m_replySocket) {
                break;
            }
        }

        // Remote connection, send the 'handshake' packet
        if(m_port != wxNOT_FOUND) {
            wxPrintf("codelite-lldb: sending handshake packet\n");
            LLDBRemoteHandshakePacket handshake;
            handshake.SetHost(::wxGetHostName());
            m_replySocket->WriteMessage(handshake.ToJSON().format());
        }

        // handle the connection to the thread
        m_networkThread = new LLDBNetworkServerThread(this, m_replySocket->GetSocket());
        m_networkThread->Start();

    } catch(clSocketException& e) {
        wxPrintf("codelite-lldb: an error occurred while waiting for connection. %s\n", e.what().c_str());
        Cleanup();

        // exit
        throw clSocketException("Failed to accept new connection");
    }
}
Example #3
0
void CodeLiteLLDBApp::AttachProcess(const LLDBCommand& command)
{
    wxPrintf("codeite-lldb: attaching to process with PID %d\n", command.GetProcessID());
    if(!InitializeLLDB(command)) {
        return;
    }

    lldb::SBError errorCode;
    lldb::SBListener listener;
    lldb::SBProcess process = m_target.AttachToProcessWithID(listener, (lldb::pid_t)command.GetProcessID(), errorCode);
    if(!errorCode.Success()) {
        wxPrintf("codeite-lldb: error attaching process %d. '%s'\n", command.GetProcessID(), errorCode.GetCString());
        NotifyExited();
        return;
    }
    wxPrintf("codeite-lldb: process attached successfully\n");

    // Launch the thread that will handle the LLDB process events
    m_lldbProcessEventThread =
        new LLDBProcessEventHandlerThread(this, m_debugger, m_target.GetProcess(), kDebugSessionTypeAttach);
    m_lldbProcessEventThread->Start();

    // In any case, reset the interrupt reason
    m_interruptReason = kInterruptReasonNone;

    // Notify codelite that the debugger started successfully
    NotifyStarted(kDebugSessionTypeAttach);
}
Example #4
0
void InteractiveInputTestCase::TestSingleIstance()
{
#ifdef TEST_SNGLINST
    wxPuts(wxT("\n*** Testing wxSingleInstanceChecker ***"));

    wxSingleInstanceChecker checker;
    if ( checker.Create(wxT(".wxconsole.lock")) )
    {
        if ( checker.IsAnotherRunning() )
        {
            wxPrintf(wxT("Another instance of the program is running, exiting.\n"));
            return;
        }

        // wait some time to give time to launch another instance
        wxPuts(wxT("If you try to run another instance of this program now, it won't start."));
        wxPrintf(wxT("Press \"Enter\" to exit wxSingleInstanceChecker test and proceed..."));
        wxFgetc(stdin);
    }
    else // failed to create
    {
        wxPrintf(wxT("Failed to init wxSingleInstanceChecker.\n"));
    }
    
    wxPuts("\n");
#endif // defined(TEST_SNGLINST)
}
Example #5
0
void InteractiveInputTestCase::TestRegExInteractive()
{
#ifdef TEST_REGEX 
    wxPuts(wxT("*** Testing RE interactively ***"));

    for ( ;; )
    {
        wxChar pattern[128];
        wxPrintf(wxT("Enter a pattern (press ENTER or type 'quit' to escape): "));
        if ( !wxFgets(pattern, WXSIZEOF(pattern), stdin) )
            break;

        // kill the last '\n'
        pattern[wxStrlen(pattern) - 1] = 0;

        if (pattern[0] == '\0' || wxStrcmp(pattern, "quit") == 0)
            break;
            
        wxRegEx re;
        if ( !re.Compile(pattern) )
        {
            continue;
        }

        wxChar text[128];
        for ( ;; )
        {
            wxPrintf(wxT("Enter text to match: "));
            if ( !wxFgets(text, WXSIZEOF(text), stdin) )
                break;

            // kill the last '\n'
            text[wxStrlen(text) - 1] = 0;

            if ( !re.Matches(text) )
            {
                wxPrintf(wxT("No match.\n"));
            }
            else
            {
                wxPrintf(wxT("Pattern matches at '%s'\n"), re.GetMatch(text).c_str());

                size_t start, len;
                for ( size_t n = 1; ; n++ )
                {
                    if ( !re.GetMatch(&start, &len, n) )
                    {
                        break;
                    }

                    wxPrintf(wxT("Subexpr %u matched '%s'\n"),
                             n, wxString(text + start, len).c_str());
                }
            }
        }
        
        wxPuts("\n");
    }
#endif // TEST_REGEX
}
Example #6
0
void CodeLiteLLDBApp::ApplyBreakpoints(const LLDBCommand& command)
{
    wxPrintf("codelite-lldb: ApplyBreakpoints called\n");
    if ( m_target.GetProcess().GetState() == lldb::eStateStopped ) {
        wxPrintf("codelite-lldb: ApplyBreakpoints: process state is stopped - will apply them now\n");
        // we can apply the breakpoints
        // Apply all breakpoints with an-invalid breakpoint ID
        LLDBBreakpoint::Vec_t breakpoints = command.GetBreakpoints();
        while( !breakpoints.empty() ) {
            LLDBBreakpoint::Ptr_t breakPoint = breakpoints.at(0);
            if ( !breakPoint->IsApplied() ) {
                switch( breakPoint->GetType() ) {
                case LLDBBreakpoint::kFunction: {
                    wxPrintf("codelite-lldb: creating breakpoint by name: %s\n", breakPoint->GetName());
                    m_target.BreakpointCreateByName(breakPoint->GetName().mb_str().data(), NULL);
                    break;
                }
                case LLDBBreakpoint::kFileLine: {
                    wxPrintf("codelite-lldb: creating breakpoint by location: %s,%d\n", breakPoint->GetFilename(), breakPoint->GetLineNumber());
                    m_target.BreakpointCreateByLocation(breakPoint->GetFilename().mb_str().data(), breakPoint->GetLineNumber());
                    break;
                }
                }
            }
            breakpoints.erase(breakpoints.begin());
        }
        NotifyBreakpointsUpdated();

    } else {
        wxPrintf("codelite-lldb: ApplyBreakpoints: process state is _NOT_ Stopped - interrupting process\n");
        // interrupt the process
        m_interruptReason = kInterruptReasonApplyBreakpoints;
        m_target.GetProcess().SendAsyncInterrupt();
    }
}
Example #7
0
    void BenchmarkRoundedRectangles(const wxString& msg, wxDC& dc)
    {
        if ( !opts.testRectangles )
            return;

        if ( opts.mapMode != 0 )
            dc.SetMapMode((wxMappingMode)opts.mapMode);
        if ( opts.penWidth != 0 )
            dc.SetPen(wxPen(*wxWHITE, opts.penWidth));

        dc.SetBrush( *wxCYAN_BRUSH );

        wxPrintf("Benchmarking %s: ", msg);
        fflush(stdout);

        wxStopWatch sw;
        for ( int n = 0; n < opts.numIters; n++ )
        {
            int x = rand() % opts.width,
                y = rand() % opts.height;

            dc.DrawRoundedRectangle(x, y, 48, 32, 8);
        }

        const long t = sw.Time();

        wxPrintf("%ld rounded rects done in %ldms = %gus/rect\n",
                 opts.numIters, t, (1000. * t)/opts.numIters);
    }
Example #8
0
int main(int argc, char **argv)
{
    wxApp::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, "program");

    wxInitializer initializer;
    if ( !initializer )
    {
        fprintf(stderr, "Failed to initialize the wxWidgets library, aborting.");
        return -1;
    }

    wxCmdLineParser parser(cmdLineDesc, argc, argv);
    switch ( parser.Parse() )
    {
        case -1:
            // help was given, terminating
            break;

        case 0:
            // everything is ok; proceed
            if (parser.Found("d"))
            {
                wxPrintf("Dummy switch was given...\n");

                while (1)
                {
                    wxChar input[128];
                    wxPrintf("Try to guess the magic number (type 'quit' to escape): ");
                    if ( !wxFgets(input, WXSIZEOF(input), stdin) )
                        break;

                    // kill the last '\n'
                    input[wxStrlen(input) - 1] = 0;
                    
                    if (wxStrcmp(input, "quit") == 0)
                        break;

                    long val;
                    if (!wxString(input).ToLong(&val))
                    {
                        wxPrintf("Invalid number...\n");
                        continue;
                    }

                    if (val == 42)
                        wxPrintf("You guessed!\n");
                    else
                        wxPrintf("Bad luck!\n");
                }
            }
            break;

        default:
            break;
    }

    // do something useful here

    return 0;
}
Example #9
0
int main(int argc, char **argv)
{
    if ( argc < 2 ) {
        printf("usage: %s <bind string>\n", argv[0]);
        return EXIT_FAILURE;
    }

    try {
        wxString connectAddress(argv[1], wxConvUTF8);
        ZMQContext context;
        ZMQSocket s(context, ZMQSocket::Reply); // Server socket type
        s.bind( connectAddress );

        // wait for messages
        s.setTimeout( 1000 );

        while ( true ) {
            ZMQMessage incMessage;
            if ( s.recvMessage( incMessage ) ) {
                wxPrintf(wxT("Received message: %s\n"), incMessage.GetString().c_str());

                // Message received!
                // process it
                wxString reply( incMessage.GetString() );
                reply << wxT(" - a reply!");
                s.sendMessage( reply );

            }
        }

    } catch (ZMQException &e) {
        wxPrintf(wxT("error: %s\n"), e.What().c_str());
    }
    return 0;
}
Example #10
0
    void BenchmarkLines(const char *msg, wxDC& dc)
    {
        if ( opts.mapMode != 0 )
            dc.SetMapMode(opts.mapMode);
        if ( opts.penWidth != 0 )
            dc.SetPen(wxPen(*wxWHITE, opts.penWidth));

        wxPrintf("Benchmarking %s DC: ", msg);

        wxStopWatch sw;
        int x = 0,
            y = 0;
        for ( int n = 0; n < opts.numLines; n++ )
        {
            int x1 = rand() % opts.width,
                y1 = rand() % opts.height;

            dc.DrawLine(x, y, x1, y1);

            x = x1;
            y = y1;
        }

        const long t = sw.Time();

        wxPrintf("%d lines done in %lums = %gus/line\n",
                 opts.numLines, t, (1000. * t)/opts.numLines);
    }
Example #11
0
void CodeLiteLLDBApp::Cleanup()
{
    wxPrintf("codelite-lldb: Cleanup() called...\n");
    m_variables.clear();
    m_watches.clear();

    wxDELETE(m_networkThread);
    wxDELETE(m_lldbProcessEventThread);

    m_interruptReason = kInterruptReasonNone;
    m_debuggeePid = wxNOT_FOUND;

    if(m_target.IsValid()) {
        m_target.DeleteAllBreakpoints();
        m_target.DeleteAllWatchpoints();

        // detach from the process
        if(m_sessionType == kDebugSessionTypeAttach) {
            wxPrintf("codelite-lldb: detaching from process ID %d\n", (int)m_target.GetProcess().GetProcessID());
            m_target.GetProcess().Detach();
        }
        m_debugger.DeleteTarget(m_target);
    }
    m_sessionType = kDebugSessionTypeNormal;
    wxPrintf("codelite-lldb: Cleanup() called... done\n");
}
Example #12
0
bool CodeLiteLLDBApp::OnInit()
{
    try {
        if(m_port != wxNOT_FOUND) {
            m_acceptSocket.CreateServer(m_ip.mb_str(wxConvUTF8).data(), m_port);

        } else {
            m_acceptSocket.CreateServer(m_debuggerSocketPath.mb_str(wxConvUTF8).data());
        }

    } catch(clSocketException& e) {
        if(m_port == wxNOT_FOUND) {
            wxPrintf("codelite-lldb: caught exception: %s\n", e.what());
            wxPrintf("codelite-lldb: failed to create server on %s. %s\n", m_debuggerSocketPath, strerror(errno));

        } else {
            wxPrintf("codelite-lldb: caught exception: %s\n", e.what());
            wxPrintf("codelite-lldb: failed to create server on %s. %s\n",
                     (wxString() << m_ip << ":" << m_port),
                     strerror(errno));
        }
        return false;
    }
    return true;
}
Example #13
0
    void BenchmarkImages(const wxString& msg, wxDC& dc)
    {
        if ( !opts.testImages )
            return;

        if ( opts.mapMode != 0 )
            dc.SetMapMode((wxMappingMode)opts.mapMode);

        wxPrintf("Benchmarking %s: ", msg);
        fflush(stdout);

        wxImage image(wxSize(opts.width, opts.height), false /* don't clear */);

        wxStopWatch sw;
        for ( int n = 0; n < opts.numIters; n++ )
        {
            UpdateRGB(image.GetData(), n);
            dc.DrawBitmap(image, 0, 0);
        }

        const long t = sw.Time();

        wxPrintf("%ld images done in %ldms = %gus/image or %ld FPS\n",
                 opts.numIters, t, (1000. * t)/opts.numIters,
                 (1000*opts.numIters + t - 1)/t);
    }
Example #14
0
void CodeLiteLLDBApp::DeleteBreakpoints(const LLDBCommand& command)
{
    CHECK_DEBUG_SESSION_RUNNING();

    const LLDBBreakpoint::Vec_t& bps = command.GetBreakpoints();
    if(bps.empty()) {
        return;
    }

    wxPrintf("codelite-lldb: DeleteBreakpoints called\n");
    if(m_target.GetProcess().GetState() == lldb::eStateStopped) {
        wxPrintf("codelite-lldb: DeleteBreakpoints: process state is Stopped - will apply them now\n");
        for(size_t i = 0; i < bps.size(); ++i) {
            LLDBBreakpoint::Ptr_t breakpoint = bps.at(i);
            wxPrintf("codelite-lldb: deleting breakpoint: %s\n", breakpoint->ToString());
            if(breakpoint->IsApplied()) {
                lldb::SBBreakpoint lldbBreakpoint = m_target.FindBreakpointByID(breakpoint->GetId());
                if(lldbBreakpoint.IsValid()) {
                    lldbBreakpoint.ClearAllBreakpointSites();
                    m_target.BreakpointDelete(lldbBreakpoint.GetID());
                }
            }
        }
        NotifyBreakpointsUpdated();

    } else {
        wxPrintf("codelite-lldb: DeleteBreakpoints: process is Busy - will interrupt it\n");
        m_interruptReason = kInterruptReasonDeleteBreakpoint;
        m_target.GetProcess().SendAsyncInterrupt();
    }
}
Example #15
0
    void BenchmarkEllipses(const wxString& msg, wxDC& dc)
    {
        if ( !opts.testEllipses )
            return;

        if ( opts.mapMode != 0 )
            dc.SetMapMode((wxMappingMode)opts.mapMode);
        if ( opts.penWidth != 0 )
            dc.SetPen(wxPen(*wxWHITE, opts.penWidth));

        dc.SetBrush( *wxBLUE_BRUSH );

        wxPrintf("Benchmarking %s: ", msg);
        fflush(stdout);

        wxStopWatch sw;
        for ( long n = 0; n < opts.numIters; n++ )
        {
            int x = rand() % opts.width,
                y = rand() % opts.height;

            dc.DrawEllipse(x, y, 48, 32);
        }

        const long t = sw.Time();

        wxPrintf("%ld ellipses done in %ldms = %gus/ellipse\n",
                 opts.numIters, t, (1000. * t)/opts.numIters);
    }
Example #16
0
FileIO::FileIO(const wxString & name, FileIOMode mode)
: mName(name),
  mMode(mode),
  mInputStream(NULL),
  mOutputStream(NULL),
  mOpen(false)
{
   wxString scheme;

      if (mMode == FileIO::Input) {
         mInputStream = new wxFFileInputStream(mName);
         if (mInputStream == NULL || !mInputStream->IsOk()) {
            wxPrintf(wxT("Couldn't get input stream: %s\n"), name.c_str());
            return;
         }
      }
      else {
         mOutputStream = new wxFFileOutputStream(mName);
         if (mOutputStream == NULL || !mOutputStream->IsOk()) {
            wxPrintf(wxT("Couldn't get output stream: %s\n"), name.c_str());
            return;
         }
      }

      mOpen = true;
}
Example #17
0
    void BenchmarkLines(const wxString& msg, wxDC& dc)
    {
        if ( !opts.testLines )
            return;

        if ( opts.mapMode != 0 )
            dc.SetMapMode((wxMappingMode)opts.mapMode);
        if ( opts.penWidth != 0 )
            dc.SetPen(wxPen(*wxWHITE, opts.penWidth));

        wxPrintf("Benchmarking %s: ", msg);
        fflush(stdout);

        wxStopWatch sw;
        int x = 0,
            y = 0;
        for ( int n = 0; n < opts.numIters; n++ )
        {
            int x1 = rand() % opts.width,
                y1 = rand() % opts.height;

            dc.DrawLine(x, y, x1, y1);

            x = x1;
            y = y1;
        }

        const long t = sw.Time();

        wxPrintf("%ld lines done in %ldms = %gus/line\n",
                 opts.numIters, t, (1000. * t)/opts.numIters);
    }
Example #18
0
void TestResult::testsEnded() {
  if (failureCount > 0)
    wxPrintf("\n%ld tests run [%ld checks]: there were %ld failures!\n",
             testCount, checkCount, failureCount);
  else
    wxPrintf("\n%ld tests run [%ld checks]: all tests passed!\n",
             testCount, checkCount);
}
Example #19
0
bool OyunApp::OnInit()
{
	// Play like a nice Linux application
	for (int i = 1 ; i < argc ; i++)
	{
		if (!wxStrcmp(argv[i], wxT("--version")))
		{
			const wchar_t *version = wxT(STRINGIZE( OYUN_VERSION ));
			const wxString verstring =
				_("Oyun %ls\n"
				  "Copyright (C) 2004-2011 Charles Pence\n"
				  "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n"
				  "This is free software: you are free to change and redistribute it.\n"
				  "There is NO WARRANTY, to the extent permitted by law.\n");
			wxPrintf(verstring, version);
			
			return false;
		}
		else if (!wxStrcmp(argv[i], wxT("--help")))
		{
			const wxString helpstring =
				_("Usage: oyun [OPTION]...\n"
				  "Run an evolutionary game theory tournament.\n"
				  "\n"
				  "  --test       run the Oyun testing suite\n"
				  "  --help       display this help and exit\n"
				  "  --version    output version information and exit\n"
				  "\n"
				  "Report bugs to: <*****@*****.**>.\n"
				  "Oyun home page: <http://charlespence.net/oyun/>.\n");
			wxPrintf(wxT("%s"), helpstring);
			
			return false;
		}
    else
		{
			// Invalid command-line parameter
			wxPrintf(_("oyun: unrecognized option `%ls'\n"
			           "Try `oyun --help' for more information.\n"), argv[i]);
			
			return false;
		}
	}
	
	// Seed the RNG
	Random::Seed(time(NULL));
	
#ifdef __WXMAC__
	// Create the common OS X menu bar if we need it
	CreateMacMenuBar();
#endif
	
	// Make the first wizard
	CreateWizard();
	
	return true;
}
Example #20
0
/* static */
void BenchApp::ListBenchmarks()
{
    wxPrintf("Available benchmarks:\n");
    for ( Bench::Function *func = Bench::Function::GetFirst();
          func;
          func = func->GetNext() )
    {
        wxPrintf("\t%s\n", func->GetName());
    }
}
LLDBProcessEventHandlerThread::~LLDBProcessEventHandlerThread()
{
    wxPrintf("codelite-lldb: Process Event Handler thread is going down...\n");
    if ( IsAlive() ) {
        Delete(NULL, wxTHREAD_WAIT_BLOCK);
    } else {
        Wait(wxTHREAD_WAIT_BLOCK);
    }
    wxPrintf("codelite-lldb: Process Event Handler thread is going down...done\n");
}
Example #22
0
void EmbeddedGamePanel::_onPaint(wxPaintEvent& evt)
{
    wxPaintDC dc(this);
    m_pGLContext->SetCurrent(*m_pGLCanvas);

    if(m_L == NULL)
    {
        // Its rather hacky to be loading the Lua side of things from within
        // the paint handler, but Lua needs an OpenGL context to be active, and
        // we cannot give it one during the EmbeddedGamePanel constructor.
        loadLua();
    }

    // Update the OpenGL projection matrix and Lua window size settings to keep
    // a 1:1 mapping between world space and screen space
    const wxSize szClient = GetClientSize();
    glViewport(0, 0, szClient.x, szClient.y);
    GLdouble fWidth = (GLdouble)szClient.x;
    GLdouble fHeight = (GLdouble)szClient.y;
    THRenderTarget::setGLProjection(fWidth, fHeight);
    if(m_L)
    {
        lua_getglobal(m_L, "TheApp");
        if(lua_isnil(m_L, -1))
            lua_pop(m_L, 1);
        else
        {
            lua_getfield(m_L, -1, "config");
            lua_pushinteger(m_L, szClient.x);
            lua_setfield(m_L, -2, "width");
            lua_pushinteger(m_L, szClient.y);
            lua_setfield(m_L, -2, "height");
            lua_pop(m_L, 2);
        }
    }

    // Do the actual painting
    if(m_Lthread)
    {
        lua_State *L = lua_tothread(m_Lthread, 1);
        if(L == NULL)
        {
            for(int i = 1; i <= lua_gettop(m_L); ++i)
            {
                wxPrintf("m_L stack %i: %s\n", i, lua_typename(m_L, lua_type(m_L, i)));
            }
            for(int i = 1; i <= lua_gettop(m_Lthread); ++i)
            {
                wxPrintf("m_Lthread stack %i: %s\n", i, lua_typename(m_Lthread, lua_type(m_Lthread, i)));
            }
        }
        lua_pushliteral(L, "frame");
        _resume(L, 1, 0);
    }
}
Example #23
0
int main(int argc,char **argv)
{
	wxDateTime now = wxDateTime::Now();

	wxPrintf(wxT("	Tokyo:%s\n"),now.Format(wxT("%a %T"),wxDateTime::GMT9).c_str());
	wxPrintf(wxT("	Moscow:%s\n"),now.Format(wxT("%a %T"),wxDateTime::MSD).c_str());
	wxPrintf(wxT("	Budapest:%s\n"),now.Format(wxT("%a %T"),wxDateTime::CEST).c_str());
	wxPrintf(wxT("	New York:%s\n"),now.Format(wxT("%a %T"),wxDateTime::EDT).c_str());

	return 0;
}
Example #24
0
void wxLuaCheckStack::OutputMsg(const wxString& msg) const
{
    if (m_print_to_console)
    {
#if  defined(__WXMSW__)
    //OutputDebugString(msg.c_str());
    wxPrintf(wxT("%s"), msg.c_str()); fflush(stdout);
#else //if defined(__WXGTK__) || defined(__WXMAC__)
    wxPrintf(wxT("%s"), msg.c_str());
#endif
    }
}
Example #25
0
void PHPSourceFile::PrintStdout()
{
    // print the alias table
    wxPrintf("Alias table:\n");
    wxPrintf("===========\n");
    std::map<wxString, wxString>::iterator iter = m_aliases.begin();
    for(; iter != m_aliases.end(); ++iter) {
        wxPrintf("%s => %s\n", iter->first, iter->second);
    }
    wxPrintf("===========\n");
    if(m_scopes.empty()) return;
    m_scopes.front()->PrintStdout(0);
}
Example #26
0
void InteractiveOutputTestCase::TestUserInfo()
{
#ifdef TEST_INFO_FUNCTIONS
    wxPuts(wxT("*** Testing user info functions ***\n"));

    wxPrintf(wxT("User id is:\t%s\n"), wxGetUserId().c_str());
    wxPrintf(wxT("User name is:\t%s\n"), wxGetUserName().c_str());
    wxPrintf(wxT("Home dir is:\t%s\n"), wxGetHomeDir().c_str());
    wxPrintf(wxT("Email address:\t%s\n"), wxGetEmailAddress().c_str());

    wxPuts(wxEmptyString);
#endif // TEST_INFO_FUNCTIONS
}
Example #27
0
int main(int , char**)
{
    unsigned long ulElapsedTime = 0;

    wxInitialize();

    wxPrintf(wxT("Task Instance Performance Measurement...\n"));
    ParserTaskInstances(ulElapsedTime);
    wxPrintf(wxT("Task Instance 100000 Records: '%d' milliseconds\n"), ulElapsedTime);

    wxUninitialize();

    return 0;
}
Example #28
0
void CatheterFrame::OnApplyCurrent(int btnId) {
/*    wxTextCtrl *currentField;
    int channel;
    switch (btnId) {
        case ID_CURRENT_BUTTON1:
            currentField = (wxTextCtrl*)(CatheterFrame::controlPanel->FindWindow(ID_CURRENT_TEXT1));
            channel=0;
            break;
        case ID_CURRENT_BUTTON2:
            currentField = (wxTextCtrl*)(CatheterFrame::controlPanel->FindWindow(ID_CURRENT_TEXT2));
            channel=1;
            break;
        case ID_CURRENT_BUTTON3:
            currentField = (wxTextCtrl*)(CatheterFrame::controlPanel->FindWindow(ID_CURRENT_TEXT3));
            channel=2;
            break;
        case ID_CURRENT_BUTTON4:
            currentField = (wxTextCtrl*)(CatheterFrame::controlPanel->FindWindow(ID_CURRENT_TEXT4));
            channel=3;
            break;
        case ID_CURRENT_BUTTON5:
            currentField = (wxTextCtrl*)(CatheterFrame::controlPanel->FindWindow(ID_CURRENT_TEXT5));
            channel=4;
            break;
        case ID_CURRENT_BUTTON6:
            currentField = (wxTextCtrl*)(CatheterFrame::controlPanel->FindWindow(ID_CURRENT_TEXT6));
            channel=5;
            break;
    }
    if (currentField == NULL) {*/
        wxWindowList children = CatheterFrame::controlPanel->GetChildren();
        for (int i=0; i<children.size(); i++) {
            wxPrintf(children[i]->GetLabel());
            wxPrintf("\n");
        }
/*    } else {
    double current = atof(static_cast<const char *>((currentField->GetLineText(0)).c_str()));
    unsigned int res;
    dir_t dir;
    
    convertCurrent(current, &res, &dir);
    packetVectWindow[currentWindowPacket].cmds[channel].data12 = res;
    packetVectWindow[currentWindowPacket].cmds[channel].dir = dir;

    wxString msg = "changed channel currnet to ";
    msg += currentField->GetLineText(0);
    wxMessageBox(msg);
    }*/
}
Example #29
0
void OnTerminate(int signo)
{
    // Remove the socket path
    if ( !s_localSocket.IsEmpty()) {
        wxPrintf("codelite-lldb: removing socket file '%s'\n", s_localSocket);
        ::remove( s_localSocket.mb_str(wxConvUTF8).data() );
        wxPrintf("codelite-lldb: bye\n");
        exit(0);
        
    } else {
        // Kill our child process and exit
        wxPrintf("codelite-lldb: bye\n");
        exit(0);
    }
}
Example #30
0
void CodeLiteLLDBApp::EvalExpression(const LLDBCommand& command)
{
    wxPrintf("codelite-lldb: evaluating expression '%s'\n", command.GetExpression());

    if(CanInteract()) {
        lldb::SBExpressionOptions options;
        lldb::SBValue value = m_target.EvaluateExpression(command.GetExpression().mb_str(wxConvUTF8).data(), options);
        if(value.IsValid()) {

            LLDBReply reply;
            reply.SetReplyType(kReplyTypeExprEvaluated);
            reply.SetExpression(command.GetExpression());

            LLDBVariable::Vect_t vars;
            LLDBVariable::Ptr_t var(new LLDBVariable(value));
            vars.push_back(var);
            reply.SetVariables(vars);
            VariableWrapper wrapper;
            wrapper.value = value;
            // Cache the expanded variable (we will need it later for tooltip expansion
            m_variables.insert(std::make_pair(value.GetID(), wrapper));

            SendReply(reply);
        }
    }
}