Example #1
0
        //private  LaunchTool oLaunchCmd = null;

        public void fLaunchConsoleCmd(string sCurrentCmd)
        {
            ///// CURRENT APP Launch
            if (Data.oLaunchProject.oCurLaunch != null)
            {
                oCurLaunch.fSend(sCurrentCmd);
                Debug.fPrint("");
                return;
            }

            ///// CONSOLE Launch
            if (sCurrentCmd.Trim() == "")
            {
                fConsoleExit(null);
                return;
            }

            oCurLaunch = new LaunchTool();
            //      _oLaunchUrl.bWaitEndForOutput = true;
            oCurLaunch.bRedirectOutput = false; //Important
            // _oLaunchUrl.bRunInThread = false;

            oCurLaunch.dOut   = new LaunchTool.dIOut(fConsoleOut);
            oCurLaunch.dError = new LaunchTool.dIError(fConsoleOut);
            oCurLaunch.dExit  = new LaunchTool.dIExit(fConsoleExit);
            // _oLaunchUrl. = true;

            Debug.fPrint("");

            oCurLaunch.fLaunchExe("cmd.exe", "/C " + sCurrentCmd);
        }
Example #2
0
        public void fCppAstOut(LaunchTool _oThis, string _sOut)
        {
            if (_sOut == null)
            {
                return;
            }
            if (_sOut.Length > 7 && _sOut[0] == 'c' && _sOut[1] == 'w' && _sOut[2] == 'c')                //cwcAst:
            {
                if (_sOut == "cwcAst:Rdy")
                {
                    if (!oCppAstStarted)
                    {
                        oCppAstStarted = true;
                        fIsFinished();
                    }

                    fIdeSend("cwcAst:Rdy");     //ToDebug


                    //  MessageBox.Show("cwcAst:Rdy ");
                    oCppAst.fSend("*run|" + "E:/TestProjectFD/TestCw/src/HelloWorld.cpp|");

                    //	Debug.fTrace("---------------------------------YEAGH");
                }
                else
                {
                    //	 MessageBox.Show("FrromAstSend: "+  _sOut);
                    //  Debug.fTrace("cwc:OUT---- " + _sOut);
                    fIdeSend(_sOut);
                }
                //Debug.fTrace(_sOut + " lengt " + _sOut.Length.ToString());
            }
            else
            {
                fIdeSend("AA:" + _sOut);                 //ToDebug
            }


            //Debug.fTrace(_sOut);
            // this.BeginInvoke((MethodInvoker)delegate {

            //	 });
        }
Example #3
0
        public static string fDelocaliseExe(string _sPath)
        {
//fLaunchConsoleCmd("");



            LaunchTool _oSubCmd = new LaunchTool();

            _oSubCmd.dExit = new LaunchTool.dIExit(fDelocaliseEnd);

            _oSubCmd.bRedirectOutput = false;
            //_oSubCmd.bReturnBoth= true;
            _oSubCmd.bReturnError = true;
            //_oSubCmd.bRunInThread = false;
            _oSubCmd.bWaitEndForOutput = true;

            string sResult = _oSubCmd.fLaunchExe(_sPath, " @wDeloc ");

            _oSubCmd.fSend("Cwc:Launch by " + Data.MainProcess.Handle); //Remove "pause" bug ?

            while (_oSubCmd.bExeLaunch)
            {
                //Thread.Sleep(1);
                Thread.CurrentThread.Join(1);
            }
            sResult = _oSubCmd.sError;


            int _nBegin = sResult.IndexOf("wOut");

            if (_nBegin != -1)
            {
                sResult = sResult.Substring(_nBegin);
            }

            //	fDebug("!!RESULT!: " + sResult);
            //fDebug("-----------------------------: ");

            return(sResult);
        }
Example #4
0
        public GDB(LaunchProject _oLaunchProject, LaunchTool _oProcess, string _sGdbPath, string _sExePath, CompilerData _oCompiler, string _sSubArg = "")
        {
            nLimitNbOutput = LIMIT_OUTPUT;
            singleton      = this;

            if (_sSubArg != "")
            {
                _sSubArg = " " + _sSubArg;
            }


            oLaunchProject = _oLaunchProject;
            oProcess       = _oProcess;

            oProcess.dOut   = new LaunchTool.dIOut(fAppOut);
            oProcess.dError = new LaunchTool.dIError(fAppError);

            oProcess.bHidden         = true;
            oProcess.bRedirectOutput = true; //DBG assole in !bRedirectOutput

            oProcess.sWorkPath = Path.GetDirectoryName(_sExePath);
            //Output.TraceAction("Dir: " +  oProcess.sWorkPath );


            //oProcess.fLaunchExe(_sGdbPath, "--args " + _oCompiler.oModuleData.sCurrFolder+ _oCompiler.sExe_Sanitizer + " " + " -exit_code_if_errors 1 -malloc_callstacks -no_soft_kills   -no_soft_kills  -pause_at_exit  -batch -crash_at_unaddressable -crash_at_error " + _sExePath   );

            bool _bSanitize = true;

            //bool _bSanitize = false;

            if (Data.fIsDataTrue("Options/Debug Type/Sanitizer"))
            {
                //if(_bSanitize) {
                //oProcess.bExterneLaunch = false;
                //  oProcess.bHidden = false;
                //     oProcess.bRedirectOutput = false;
                // oProcess.fLaunchExe(_sGdbPath, "--args " + _oCompiler.oModuleData.sCurrFolder+ _oCompiler.sExe_Sanitizer + " " + " -v -exit_code_if_errors 1 -malloc_callstacks -no_soft_kills -batch -pause_at_exit " + _sExePath   );
                // oProcess.fLaunchExe( _oCompiler.oModuleData.sCurrFolder+ _oCompiler.sExe_Sanitizer,  " -v -exit_code_if_errors 1 -malloc_callstacks -no_soft_kills -batch -pause_at_exit " + _sExePath   );


                string _sSanitizer = _oCompiler.oGblConfigType.fGetNode(null, new string[] { "Exe", "Sanitizer" }, "");

                // oProcess.fLaunchExe( _oCompiler.oModuleData.sCurrFolder+ _oCompiler.sExe_Sanitizer,  " -no_callstack_use_fp   -no_callstack_use_top_fp  -v -exit_code_if_errors 1 -malloc_callstacks  -batch " + _sExePath   ); //-no_soft_kills
                oProcess.fLaunchExe(_sSanitizer, " -no_callstack_use_fp   -no_callstack_use_top_fp  -v -exit_code_if_errors 1 -malloc_callstacks  -batch " + _sExePath + _sSubArg);       //-no_soft_kills

                return;
            }
            else                                                                           //   if(Data.fIsDataTrue("Options/Debug Type/Debugger") ){
            {
                oProcess.fLaunchExe(_sGdbPath, "--args \"" + _sExePath + "\"" + _sSubArg); //GDB only
            }

            fLoadBreakpoints();

            /*
             *
             * To enter non-stop mode, use this sequence of commands before you run or attach to your program:
             *
             # Enable the async interface.
             # set target-async 1
             #
             # If using the CLI, pagination breaks non-stop.
             # set pagination off
             #
             # Finally, turn it on!
             # set non-stop on
             #
             * */

            // oProcess.fSend("set target-async 1");
            //  oProcess.fSend("set pagination off");
            //  oProcess.fSend("set non-stop on");


            oProcess.fSend("cd " + Path.GetDirectoryName(_sExePath));

            oProcess.fSend("set width 0");
            oProcess.fSend("set filename-display absolute");
            oProcess.fSend("set breakpoint pending on");
            oProcess.fSend("break GDB_Func_Break");
            oProcess.fSend("break GDB_Func_ExecuteCmds");

            // oProcess.fSend("set output-radix 16");//All in hex?



            fSetAllGdbBreakpoint();


            //oProcess.fSend("set new-console on");



            // oProcess.fSend("tbreak main");

            //oProcess.fSend("break _start");  //Entry point: 0x4014a0
            //oProcess.fSend("set backtrace past-entry on");

            /*
             * oProcess.fSend("info files");  //Entry point: 0x4014a0
             * oProcess.fSend("break *0x4014a0");
             * oProcess.fSend("show backtrace past-entry");
             */

            oProcess.fSend("run");  bRunning = true;
            //    oProcess.bRedirectOutput = false;
            //   oProcess.processStartInfo.RedirectStandardInput = false;Ok

            Start();
        }
Example #5
0
 public override void fBreakpointSet(Breakpoint _oBreakpoint)
 {
     oProcess.fSend("break " + _oBreakpoint.sPath + ":" + _oBreakpoint.nLine);
 }