void Ide::BuildAndDebug0(const String& srcfile) { if(Build()) { One<Host> h = CreateHostRunDir(); h->ChDir(GetFileFolder(target)); VectorMap<String, String> bm = GetMethodVars(method); String dbg = bm.Get("DEBUGGER", Null); if(IsNull(dbg)) { if(bm.Get("BUILDER", Null) == "MSC71") { String sln = ForceExt(target, ".sln"); if(GetFileLength(sln) > 0) h->Launch("devenv \"" + h->GetHostPath(sln) + "\" " // + "\"" + h->GetHostPath(srcfile) + "\"" //TRC, 2011/09/26: wrong devenv argument ); else h->Launch("devenv \"" + h->GetHostPath(target) //+ "\" \"" + h->GetHostPath(srcfile) //TRC, 2011/09/26: wrong devenv argument + "\" /debugexe " ); return; } dbg = "gdb"; } else h->Launch('\"' + dbg + "\" \"" // + h->GetHostPath(srcfile) + ' ' + h->GetHostPath(target) + "\"", true); } }
void Ide::BuildAndExecute() { if(Build()) { int time = msecs(); One<Host> h = CreateHostRunDir(); h->ChDir(Nvl(rundir, GetFileFolder(target))); String cmdline; if(!runexternal) cmdline << '\"' << h->GetHostPath(target) << "\" "; cmdline << ToSystemCharset(runarg); int exitcode; switch(runmode) { case RUN_WINDOW: HideBottom(); h->Launch(cmdline, FindIndex(SplitFlags(mainconfigparam, true), "GUI") < 0); break; case RUN_CONSOLE: ShowConsole(); PutConsole(String().Cat() << "Executing: " << cmdline); console.Sync(); exitcode = h->ExecuteWithInput(cmdline); PutConsole("Finished in " + GetPrintTime(time) + ", exit code: " + AsString(exitcode)); break; case RUN_FILE: { HideBottom(); String fn; if(IsNull(stdout_file)) fn = ForceExt(target, ".ol"); else fn = stdout_file; FileOut out(fn); if(!out) { PromptOK("Unable to open output file [* " + DeQtf(stdout_file) + "] !"); return; } if(h->Execute(cmdline, out) >= 0) { out.Close(); EditFile(fn); } } } } }
virtual void Launch(const char *cmdline, bool) { host->Launch(cmdline); }