diff --git a/uppsrc/ide/Debuggers/Gdb_MI2.cpp b/uppsrc/ide/Debuggers/Gdb_MI2.cpp index fd0fedbb7..13e026b96 100644 --- a/uppsrc/ide/Debuggers/Gdb_MI2.cpp +++ b/uppsrc/ide/Debuggers/Gdb_MI2.cpp @@ -1061,7 +1061,7 @@ void Gdb_MI2::UpdateLocalVars(void) localVarNames.Clear(); localVarValues.Clear(); - MIValue iLoc = MICmd("stack-list-variables 2"); + MIValue iLoc = MICmd("stack-list-variables 1"); if(!iLoc || iLoc.IsEmpty()) return; MIValue &loc = iLoc["variables"]; @@ -1079,6 +1079,15 @@ void Gdb_MI2::UpdateLocalVars(void) } } +// update 'this' inspector data +void Gdb_MI2::UpdateThis(void) +{ +/* + MIValue thisVal = MICmd("data-evaluate-expression *this"); + RLOG(thisVal.Dump()); +*/ +} + // sync watches treectrl void Gdb_MI2::SyncLocals() { @@ -1147,6 +1156,10 @@ void Gdb_MI2::SyncData() // those are needed for Autos, Locals and Tooltips UpdateLocalVars(); + // update stored 'this' member data + // also used for tooltips and 'this' pane page + UpdateThis(); + switch(tab.Get()) { case 0: diff --git a/uppsrc/ide/Debuggers/Gdb_MI2.h b/uppsrc/ide/Debuggers/Gdb_MI2.h index c0a33569d..2345ae146 100644 --- a/uppsrc/ide/Debuggers/Gdb_MI2.h +++ b/uppsrc/ide/Debuggers/Gdb_MI2.h @@ -109,14 +109,19 @@ class Gdb_MI2 : public Debugger, public ParentCtrl IndexwatchesExpressions; VectorwatchesValues; + // 'this' variable inspection data + IndexthisNames; + VectorthisFullNames; + VectorthisValues; + // stored autos expressions, values and types String autoLine; // update local variables on demand void UpdateLocalVars(void); - // update stored watches values on demand - void UpdateWatches(void); + // update 'this' inspector data + void UpdateThis(void); // logs frame data on console void LogFrame(String const &msg, MIValue &frame); diff --git a/uppsrc/ide/Debuggers/MIValue.cpp b/uppsrc/ide/Debuggers/MIValue.cpp index d702c04e9..5ebcba3a3 100644 --- a/uppsrc/ide/Debuggers/MIValue.cpp +++ b/uppsrc/ide/Debuggers/MIValue.cpp @@ -291,6 +291,8 @@ MIValue &MIValue::Get(const char *key) { if(type != MITuple) return ErrorMIValue("Not a Tuple value type"); + if(tuple.Find(key) < 0) + return ErrorMIValue(String("key '") + key + "' not found"); return tuple.Get(key); }