void Ide::Periodic() { CheckFileUpdate(); SetIcon(); if(debugger && debugger->IsFinished() && !IdeIsDebugLock()) IdeEndDebug(); }
void Ide::BuildAndDebug(bool runto) { VectorMap<String, String> bm = GetMethodVars(method); String builder = bm.Get("BUILDER", ""); if(!Build()) return; if(!FileExists(target)) return; if(designer) EditAsText(); One<Host> host = CreateHostRunDir(); host->ChDir(Nvl(rundir, GetFileFolder(target))); HideBottom(); editor.Disable(); #ifdef COMPILER_MSC if(builder == "GCC") if(gdbSelector) debugger = Gdb_MI2Create(host, target, runarg); else debugger = GdbCreate(host, target, runarg); else debugger = PdbCreate(host, target, runarg); #else if(gdbSelector) debugger = Gdb_MI2Create(host, target, runarg); else debugger = GdbCreate(host, target, runarg); #endif if(!debugger) return; debuglock = 0; const Workspace& wspc = IdeWorkspace(); for(int i = 0; i < wspc.GetCount(); i++) { const Package& pk = wspc.GetPackage(i); String n = wspc[i]; for(int i = 0; i < pk.file.GetCount(); i++) { String file = SourcePath(n, pk.file[i]); LineInfo& ln = Filedata(file).lineinfo; for(int i = 0; i < ln.GetCount(); i++) { LineInfoRecord& lr = ln[i]; if(!lr.breakpoint.IsEmpty()) if(!debugger->SetBreakpoint(file, lr.lineno, lr.breakpoint)) { lr.breakpoint = "\xe"; if(PathIsEqual(file, editfile)) editor.SetBreakpoint(lr.lineno, "\xe"); } } } } SetBar(); editor.Enable(); if(runto) { if(!debugger->RunTo()) IdeEndDebug(); } else debugger->Run(); }
void Gdb_MI2::Run() { MIValue val; if(firstRun) val = MICmd("exec-run"); else val = MICmd("exec-continue --all"); int i = 50; while(!started && --i) { GuiSleep(20); Ctrl::ProcessEvents(); ReadGdb(false); } if(!started) { Exclamation(t_("Failed to start application")); IdeEndDebug(); return; } Lock(); while(dbg && !stopped) { GuiSleep(20); Ctrl::ProcessEvents(); ReadGdb(false); } Unlock(); if(stopped) CheckStopReason(); started = stopped = false; firstRun = false; IdeActivateBottom(); }