diff --git a/uppsrc/CodeEditor/CodeEditor.cpp b/uppsrc/CodeEditor/CodeEditor.cpp index 6c6022269..fdd5152c3 100644 --- a/uppsrc/CodeEditor/CodeEditor.cpp +++ b/uppsrc/CodeEditor/CodeEditor.cpp @@ -696,7 +696,7 @@ void CodeEditor::SyncTip() Rect wa = GetWorkArea(); Point p = Upp::GetMousePos(); MouseTip mt; - mt.background = SColorInfo(); + mt.background = Blend(SWhite(), SLtYellow()); mt.pos = tippos; mt.sz.cx = min(DPI(1000), 2 * wa.GetWidth() / 3); if(tippos >= 0 && IsVisible() && (WhenTip(mt) || delayed_tip && DelayedTip(mt) && p == delayed_pos)) { diff --git a/uppsrc/Core/LocalProcess.cpp b/uppsrc/Core/LocalProcess.cpp index 99d914db9..a3195a5c6 100644 --- a/uppsrc/Core/LocalProcess.cpp +++ b/uppsrc/Core/LocalProcess.cpp @@ -256,12 +256,20 @@ bool LocalProcess::DoStart(const char *command, const Vector *arg, bool LLOG("wpipe[" << wpipe[0] << ", " << wpipe[1] << "]"); LLOG("epipe[" << epipe[0] << ", " << epipe[1] << "]"); -#ifdef CPU_BLACKFIN - pid = vfork(); //we *can* use vfork here, since exec is done later or the parent will exit -#else + Vector env; + if(envptr) { // need to do this while heap is working + const char *from = envptr; + while(*from) { + env.Add(from); + from += strlen(from) + 1; + } + env.Add(NULL); + } + pid = fork(); -#endif - LLOG("\tfork, pid = " << (int)pid << ", getpid = " << (int)getpid()); + // Warning: other threads are dead after this point, which means heap might be locked + + LLOG("\tfork, pid = " << (int)pid << ", getpid = " << (int)getpid()); // LOGs are iffy because of ^^^^ if(pid < 0) return false; // throw Exc(NFormat(t_("fork() error; error code = %d"), errno)); @@ -330,12 +338,6 @@ bool LocalProcess::DoStart(const char *command, const Vector *arg, bool LLOG("running execve, app = " << app << ", #args = " << args.GetCount()); if(envptr) { - const char *from = envptr; - Vector env; - while(*from) { - env.Add(from); - from += strlen(from) + 1; - } env.Add(NULL); execve(app_full, args.Begin(), (char *const *)env.Begin()); } diff --git a/uppsrc/ide/Build.cpp b/uppsrc/ide/Build.cpp index c071abb6a..e9fc2e05e 100644 --- a/uppsrc/ide/Build.cpp +++ b/uppsrc/ide/Build.cpp @@ -30,6 +30,7 @@ void Ide::BeginBuilding(bool clear_console) { SetupDefaultMethod(); HdependTimeDirty(); + Builder::cmdx_cache.Clear(); Renumber(); StopDebug(); ShowConsole(); diff --git a/uppsrc/ide/Builders/Build.cpp b/uppsrc/ide/Builders/Build.cpp index 08e80e676..0b69aa660 100644 --- a/uppsrc/ide/Builders/Build.cpp +++ b/uppsrc/ide/Builders/Build.cpp @@ -444,6 +444,7 @@ Vector MakeBuild::GetAllLibraries(const Workspace& wspc, int index, bool MakeBuild::Build(const Workspace& wspc, String mainparam, String outfile, bool clear_console) { InitBlitz(); + Builder::cmdx_cache.Clear(); String hfile = outfile + ".xxx"; SaveFile(hfile, ""); diff --git a/uppsrc/ide/Core/Builder.cpp b/uppsrc/ide/Core/Builder.cpp index 9cb89c446..32d6ed88d 100644 --- a/uppsrc/ide/Core/Builder.cpp +++ b/uppsrc/ide/Core/Builder.cpp @@ -32,6 +32,8 @@ Time Builder::GetFileTime(const String& path) const return GetFileInfo(path); } +VectorMap Builder::cmdx_cache; + String Builder::CmdX(const char *s) { // expand ` character delimited sections by executing them as commands String r, cmd; @@ -39,7 +41,15 @@ String Builder::CmdX(const char *s) for(; *s; s++) if(*s == '`') { if(cmdf) { - r << Sys(cmd); + int q = cmdx_cache.Find(cmd); + if(q >= 0) + r << cmdx_cache[q]; + else { + String h = Sys(cmd); + r << h; + cmdx_cache.Add(cmd, h); + IdeProcessEvents(); + } cmd.Clear(); } cmdf = !cmdf; diff --git a/uppsrc/ide/Core/Core.h b/uppsrc/ide/Core/Core.h index 2896c91bb..55d19e2ec 100644 --- a/uppsrc/ide/Core/Core.h +++ b/uppsrc/ide/Core/Core.h @@ -179,6 +179,8 @@ public: virtual bool IdeConsoleWait() = 0; virtual bool IdeConsoleWait(int slot) = 0; virtual void IdeConsoleOnFinish(Event<> cb) = 0; + + virtual void IdeProcessEvents() = 0; virtual bool IdeIsDebug() const = 0; virtual void IdeEndDebug() = 0; @@ -243,6 +245,8 @@ bool IdeConsoleWait(); bool IdeConsoleWait(int slot); void IdeConsoleOnFinish(Event<> cb); +void IdeProcessEvents(); + String GetSourcePackage(const String& path); String GetDefaultMethod(); @@ -576,6 +580,8 @@ struct Builder { Vector Macro; VectorMap tmpfilei; // for naming automatic response files + + static VectorMap cmdx_cache; // caching e.g. pkg-config String CmdX(const char *s); diff --git a/uppsrc/ide/Core/Ide.cpp b/uppsrc/ide/Core/Ide.cpp index ff4e18173..263bc87be 100644 --- a/uppsrc/ide/Core/Ide.cpp +++ b/uppsrc/ide/Core/Ide.cpp @@ -11,6 +11,8 @@ void PutVerbose(const char *s) { if(the_ide) the_ide->PutVerbose(s); } void PutLinking() { if(the_ide) the_ide->PutLinking(); } void PutLinkingEnd(bool ok) { if(the_ide) the_ide->PutLinkingEnd(ok); } +void IdeProcessEvents() { if(the_ide) the_ide->IdeProcessEvents(); } + const Workspace& GetIdeWorkspace() { if(the_ide) diff --git a/uppsrc/ide/clang/Indexer.cpp b/uppsrc/ide/clang/Indexer.cpp index 6f8c456ec..3aae49a23 100644 --- a/uppsrc/ide/clang/Indexer.cpp +++ b/uppsrc/ide/clang/Indexer.cpp @@ -136,7 +136,7 @@ void Indexer::BuildingPause() void Indexer::IndexerThread() { - Thread::DumpDiagnostics(); +// Thread::DumpDiagnostics(); while(!Thread::IsShutdownThreads()) { Clang clang; clang_CXIndex_setGlobalOptions(clang.index, CXGlobalOpt_ThreadBackgroundPriorityForIndexing); diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index cc93dd87a..e5a7c7b3f 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -399,6 +399,7 @@ public: virtual bool IdeConsoleWait(); virtual bool IdeConsoleWait(int slot); virtual void IdeConsoleOnFinish(Event<> cb); + virtual void IdeProcessEvents(); virtual bool IdeIsDebug() const; virtual void IdeEndDebug(); diff --git a/uppsrc/ide/idewin.cpp b/uppsrc/ide/idewin.cpp index 2a18beb2d..318e18d1e 100644 --- a/uppsrc/ide/idewin.cpp +++ b/uppsrc/ide/idewin.cpp @@ -135,6 +135,11 @@ void Ide::IdeConsoleOnFinish(Event<> cb) console.OnFinish(cb); } +void Ide::IdeProcessEvents() +{ + Ctrl::ProcessEvents(); +} + void Ide::IdeSetRight(Ctrl& ctrl) { right.Add(ctrl.SizePos());