Ide/Debuggers/Gdb_MI2 : update data tabs on frame or thread change

git-svn-id: svn://ultimatepp.org/upp/trunk@6965 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
micio 2014-02-28 15:42:36 +00:00
parent 3243e77df1
commit 83ffff4cb2
4 changed files with 48 additions and 34 deletions

View file

@ -217,6 +217,35 @@ void Gdb_MI2::SetStopThread(bool b)
stopThread = b;
}
}
// shut down threads and wait till done
void Gdb_MI2::ShutDownThreads(void)
{
// signal all other threads to stop
SetStopThread(true);
// interrupt any active GDB command
InterruptCommand();
// ugly hack, otherwise service thread can deadlock
// MUST CHECK THIS ONE....
int n = LeaveGuiMutexAll();
// give some time to recover
do
{
Sleep(20);
}
while(IsThreadRunning());
// RE-ENTER GUI MUTEX -- SEE ABOVE...
EnterGuiMutex(n);
// remove thread stopping flag
SetStopThread(false);
}
#endif
#ifdef flagMT
@ -876,6 +905,13 @@ void Gdb_MI2::DropFrames()
MIValue &fArgs = frameArgs[iFrame]["args"];
frame.Add(iFrame, FormatFrame(fInfo, fArgs));
}
// data must be synced on frame change
localSynced = false;
thisSynced = false;
watchesSynced = false;
explorerSynced = false;
frame <<= q;
}
@ -913,6 +949,13 @@ void Gdb_MI2::dropThreads()
String threadStr = Format("#%03x%s", id, (id == currentId ? "(*)" : ""));
threadSelector.Add(id, threadStr);
}
// data must be resynced on threads drop
localSynced = false;
thisSynced = false;
watchesSynced = false;
explorerSynced = false;
threadSelector <<= q;
}

View file

@ -59,6 +59,9 @@ class Gdb_MI2 : public Debugger, public ParentCtrl
bool IsStopThread(void);
private:
void SetStopThread(bool b);
// shut down threads and wait till done
void ShutDownThreads(void);
#endif
@ -236,7 +239,7 @@ class Gdb_MI2 : public Debugger, public ParentCtrl
bool watchesSynced;
bool explorerSynced;
void SyncData();
// sync ide display with breakpoint position
void SyncIde(bool frame = false);

View file

@ -261,30 +261,7 @@ MIValue Gdb_MI2::MICmd(const char *cmdLine)
// issued GDB commands (which normally can lag several seconds...)
// before issuing the command
if(IsMainThread() && IsThreadRunning())
{
// signal all other threads to stop
SetStopThread(true);
// interrupt any active GDB command
InterruptCommand();
// ugly hack, otherwise service thread can deadlock
// MUST CHECK THIS ONE....
int n = LeaveGuiMutexAll();
// give some time to recover
do
{
Sleep(20);
}
while(IsThreadRunning());
// RE-ENTER GUI MUTEX -- SEE ABOVE...
EnterGuiMutex(n);
// remove thread stopping flag
SetStopThread(false);
}
ShutDownThreads();
// quick exit for service thread
if(!IsMainThread() && IsStopThread())

View file

@ -470,15 +470,6 @@ static int UppOneSimplify(VarItem &varItem, int step)
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static String TrimChar(String const &s)
{
int pos = s.Find(" ");
if(pos >= 0)
return s.Left(pos - 1);
else
return s;
}
static int UppTimeSimplify(VarItem &varItem, int step)
{
MIValue val = varItem.EvaluateExpression(varItem.evaluableExpression);