diff --git a/uppsrc/Core/Topt.h b/uppsrc/Core/Topt.h index 96d2b19bf..7c3b0cd43 100644 --- a/uppsrc/Core/Topt.h +++ b/uppsrc/Core/Topt.h @@ -275,6 +275,12 @@ public: WithDeepCopy() {} }; +template +WithDeepCopy DeepClone(const T& src) +{ + return WithDeepCopy(src); +} + // STL compatibility hacks #define STL_ITERATOR_COMPATIBILITY \ diff --git a/uppsrc/ide/Builders/OwcBuilder.icpp b/uppsrc/ide/Builders/OwcBuilder.icpp index 52bb88512..e29918c62 100644 --- a/uppsrc/ide/Builders/OwcBuilder.icpp +++ b/uppsrc/ide/Builders/OwcBuilder.icpp @@ -307,12 +307,13 @@ bool OwcBuilder::Link(const Vector& linkfile, const String& linkoptions, if (HasFlag("DEBUG")) link << " debug all option incremental"; - if (HasFlag("WIN32")) + if (HasFlag("WIN32")) { if (HasFlag("GUI")) link << " system nt_win"; else if (HasFlag("DLL")) link << " system nt_dll"; else link << " system nt"; + } if (createmap) link << " option map"; diff --git a/uppsrc/ide/Builders/init b/uppsrc/ide/Builders/init index 9ad9edba8..e549e0805 100644 --- a/uppsrc/ide/Builders/init +++ b/uppsrc/ide/Builders/init @@ -2,19 +2,19 @@ #define _ide_Builders_icpp_init_stub #include "coff\binobj/init" #include "ide\Core/init" -#define BLITZ_INDEX__ F774b8a1ae84f2d8f255be80983d999ac +#define BLITZ_INDEX__ Fe88d4241691b2ace9390e0f69164d181 #include "GccBuilder.icpp" #undef BLITZ_INDEX__ -#define BLITZ_INDEX__ F0059f6d7377da3c3eb3cac2ae785c40f +#define BLITZ_INDEX__ F1d6ab59cb8303fabe742f0bdd97fb439 #include "MscBuilder.icpp" #undef BLITZ_INDEX__ -#define BLITZ_INDEX__ F6d37e82e414afc35c42d6c74d0c5b4ed +#define BLITZ_INDEX__ Fc874dfd308e5615d301ccf8b2652e70c #include "OwcBuilder.icpp" #undef BLITZ_INDEX__ -#define BLITZ_INDEX__ Ffe78d94eb9485fbb8fec961febd10712 +#define BLITZ_INDEX__ F266ea208d2eb267914094a29e66b5afc #include "JavaBuilder.icpp" #undef BLITZ_INDEX__ -#define BLITZ_INDEX__ Fdc76aa28fa51a1f2aee853343af491ef +#define BLITZ_INDEX__ F8c3c407c6c733c60e20f0a2d67ae304b #include "ScriptBuilder.icpp" #undef BLITZ_INDEX__ #endif diff --git a/uppsrc/ide/Core/Hdepend.cpp b/uppsrc/ide/Core/Hdepend.cpp index 1bbfd318c..fdd2d126b 100644 --- a/uppsrc/ide/Core/Hdepend.cpp +++ b/uppsrc/ide/Core/Hdepend.cpp @@ -109,17 +109,17 @@ void Hdepend::Include(const char *s, Hdepend::Info& info, const String& filedir, } static const char *SkipComment(const char *s) { - if(*s == '/') + if(*s == '/') { if(s[1] == '/') for(s += 2; *s && *s != '\n';) s++; - else if(s[1] == '*') - { + else if(s[1] == '*') { for(s += 2; *s && (*s != '*' || s[1] != '/'); s++) ; if(*s) s += 2; } + } return s; } diff --git a/uppsrc/ide/Debuggers/Gdb_MI2.cpp b/uppsrc/ide/Debuggers/Gdb_MI2.cpp index cacf1ce0c..0bdd6d894 100644 --- a/uppsrc/ide/Debuggers/Gdb_MI2.cpp +++ b/uppsrc/ide/Debuggers/Gdb_MI2.cpp @@ -706,7 +706,7 @@ void Gdb_MI2::SyncIde(bool fr) SyncData(); CleanupVariables(); #else - exploreCallback.Set(480, THISBACK1(SyncExplorer, Vector())); + exploreCallback.Set(480, THISBACK1(SyncExplorer, DeepClone(Vector()))); timeCallback.Set(500, THISBACK(SyncData)); timeCallback.Set(550, THISBACK(CleanupVariables)); #endif @@ -1098,9 +1098,10 @@ void Gdb_MI2::SyncLocals() DecThreadRunning(); } #else -void Gdb_MI2::SyncLocals(Vector localVars) +void Gdb_MI2::SyncLocals(const Vector& localVars_) { static VectorMap prev; + Vector localVars = clone(localVars_); if(localVars.IsEmpty()) { prev = DataMap(members);; @@ -1112,7 +1113,7 @@ void Gdb_MI2::SyncLocals(Vector localVars) // variables are returned as a tuple, named "variables" // containing a array of variables - MIValue lLocs = locs["variables"]; + MIValue lLocs = pick(locs["variables"]); if(!lLocs.IsArray()) return; @@ -1146,7 +1147,7 @@ void Gdb_MI2::SyncLocals(Vector localVars) // autos variables can come from members or locals... SyncAutos(); - timeCallback.Set(500, THISBACK1(SyncLocals, localVars)); + timeCallback.Set(500, THISBACK1(SyncLocals, DeepClone(localVars))); return; } @@ -1160,7 +1161,7 @@ void Gdb_MI2::SyncLocals(Vector localVars) localValues[iLoc] = v.value; locals.Set(iLoc, 1, v.value); SyncAutos(); - timeCallback.Set(100, THISBACK1(SyncLocals, localVars)); + timeCallback.Set(100, THISBACK1(SyncLocals, DeepClone(localVars))); return; } } @@ -1255,9 +1256,10 @@ void Gdb_MI2::SyncThis() DecThreadRunning(); } #else -void Gdb_MI2::SyncThis(Vector children) +void Gdb_MI2::SyncThis(const Vector& children_) { static VectorMap prev; + Vector children = clone(children_); if(children.IsEmpty()) { prev = DataMap(members);; @@ -1290,7 +1292,7 @@ void Gdb_MI2::SyncThis(Vector children) // autos variables can come from members or locals... SyncAutos(); - timeCallback.Set(500, THISBACK1(SyncThis, children)); + timeCallback.Set(500, THISBACK1(SyncThis, DeepClone(children))); return; } @@ -1304,7 +1306,7 @@ void Gdb_MI2::SyncThis(Vector children) thisValues[iVar] = v.value; members.Set(iVar, 1, v.value); SyncAutos(); - timeCallback.Set(100, THISBACK1(SyncThis, children)); + timeCallback.Set(100, THISBACK1(SyncThis, DeepClone(children))); return; } } @@ -1430,9 +1432,10 @@ void Gdb_MI2::SyncWatches() } } #else -void Gdb_MI2::SyncWatches(Vector watchesVars) +void Gdb_MI2::SyncWatches(const Vector& watchesVars_) { static VectorMap prev; + Vector watchesVars = clone(watchesVars_); if(watchesVars.IsEmpty()) { prev = DataMap(watches);; @@ -1451,7 +1454,7 @@ void Gdb_MI2::SyncWatches(Vector watchesVars) watches.Set(iWatch, 1, val); } - timeCallback.Set(500, THISBACK1(SyncWatches, watchesVars)); + timeCallback.Set(500, THISBACK1(SyncWatches, DeepClone(watchesVars_))); return; } @@ -1464,7 +1467,7 @@ void Gdb_MI2::SyncWatches(Vector watchesVars) watchesExpressions.Set(iWatch, v.evaluableExpression); watchesValues[iWatch] = v.value; watches.Set(iWatch, 1, v.value); - timeCallback.Set(100, THISBACK1(SyncWatches, watchesVars)); + timeCallback.Set(100, THISBACK1(SyncWatches, DeepClone(watchesVars))); return; } } @@ -1729,7 +1732,7 @@ bool Gdb_MI2::Create(One rval_ _host, const String& exefile, const String& #ifdef flagMT watches.WhenAcceptEdit = THISBACK(SyncWatches); #else - watches.WhenAcceptEdit = THISBACK1(SyncWatches, Vector()); + watches.WhenAcceptEdit = THISBACK1(SyncWatches, DeepClone(Vector())); #endif // this one will allow asynchronous break of running app // 2012-07-08 -- DISABLED because of GDB bugs... diff --git a/uppsrc/ide/Debuggers/Gdb_MI2.h b/uppsrc/ide/Debuggers/Gdb_MI2.h index c312ee414..219f36c84 100644 --- a/uppsrc/ide/Debuggers/Gdb_MI2.h +++ b/uppsrc/ide/Debuggers/Gdb_MI2.h @@ -221,16 +221,16 @@ class Gdb_MI2 : public Debugger, public ParentCtrl void SyncExplorer(); #else // sync local variables pane - void SyncLocals(Vector localVars = Vector()); + void SyncLocals(const Vector& localVars = Vector()); // Sync 'this' inspector data - void SyncThis(Vector children = Vector()); + void SyncThis(const Vector& children = Vector()); // sync watches treectrl - void SyncWatches(Vector children = Vector()); + void SyncWatches(const Vector& children = Vector()); // sync explorer pane - void SyncExplorer(Vector children = Vector()); + void SyncExplorer(const Vector& children = Vector()); #endif // sync data tabs, depending on which tab is shown diff --git a/uppsrc/ide/Debuggers/Gdb_MI2Explore.cpp b/uppsrc/ide/Debuggers/Gdb_MI2Explore.cpp index e085ecd15..0355d1989 100644 --- a/uppsrc/ide/Debuggers/Gdb_MI2Explore.cpp +++ b/uppsrc/ide/Debuggers/Gdb_MI2Explore.cpp @@ -86,10 +86,10 @@ void Gdb_MI2::SyncExplorer() } } #else -void Gdb_MI2::SyncExplorer(Vector children) +void Gdb_MI2::SyncExplorer(const Vector& children_) { static VectorMap prev; - + Vector children = clone(children_); if(children.IsEmpty()) { prev = DataMap(explorer); @@ -107,7 +107,7 @@ void Gdb_MI2::SyncExplorer(Vector children) // get children if complex variable if(vItem.kind == VarItem::COMPLEX) - children = vItem.GetChildren(); + children = clone(vItem.GetChildren()); else children.Add(vItem); @@ -124,7 +124,7 @@ void Gdb_MI2::SyncExplorer(Vector children) // update 'this' pane FillPane(explorer, explorerExpressions, explorerValues); - exploreCallback.Set(500, THISBACK1(SyncExplorer, children)); + exploreCallback.Set(500, THISBACK1(SyncExplorer, DeepClone(children))); return; } @@ -136,7 +136,7 @@ void Gdb_MI2::SyncExplorer(Vector children) VarItem &v = children[iVar]; explorer.Set(iVar, 1, v.value); explorerValues[iVar] = v.value; - exploreCallback.Set(100, THISBACK1(SyncExplorer, children)); + exploreCallback.Set(100, THISBACK1(SyncExplorer, DeepClone(children))); return; } } diff --git a/uppsrc/ide/Debuggers/init b/uppsrc/ide/Debuggers/init index d686fb29e..f64473c93 100644 --- a/uppsrc/ide/Debuggers/init +++ b/uppsrc/ide/Debuggers/init @@ -3,7 +3,7 @@ #include "ide\Common/init" #include "plugin\ndisasm/init" #include "HexView/init" -#define BLITZ_INDEX__ Fa2117e771964dad617cdd6a1792596ea +#define BLITZ_INDEX__ F2300ec0d3d2de4bde7af30102b728c5d #include "UppSimplifiers.icpp" #undef BLITZ_INDEX__ #endif