Browse Source

fix flickering in debugger pads

pull/18/head
Siegfried Pammer 14 years ago
parent
commit
03612a691a
  1. 38
      src/AddIns/Debugger/Debugger.AddIn/Pads/LocalVarPad.cs
  2. 23
      src/AddIns/Debugger/Debugger.AddIn/Pads/RunningThreadsPad.cs
  3. 15
      src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs

38
src/AddIns/Debugger/Debugger.AddIn/Pads/LocalVarPad.cs

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows.Threading;
using Debugger;
using Debugger.AddIn.Pads.Controls;
@ -62,29 +63,22 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -62,29 +63,22 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
return;
}
using(new PrintTimes("Local Variables refresh")) {
try {
StackFrame frame = debuggedProcess.GetCurrentExecutingFrame();
if (frame == null) return;
LoggingService.Info("Local Variables refresh");
try {
StackFrame frame = debuggedProcess.GetCurrentExecutingFrame();
if (frame == null) return;
localVarList.WatchItems.Clear();
foreach (var n in new StackFrameNode(frame).ChildNodes) {
var node = n;
debuggedProcess.EnqueueWork(
Dispatcher.CurrentDispatcher,
delegate {
localVarList.WatchItems.Add(node.ToSharpTreeNode());
}
);
}
}
catch(AbortedBecauseDebuggeeResumedException) { }
catch(Exception ex) {
if (debuggedProcess == null || debuggedProcess.HasExited) {
// Process unexpectedly exited
} else {
MessageService.ShowException(ex);
}
localVarList.WatchItems.Clear();
debuggedProcess.EnqueueForEach(
Dispatcher.CurrentDispatcher,
new StackFrameNode(frame).ChildNodes.ToList(),
n => localVarList.WatchItems.Add(n.ToSharpTreeNode())
);
} catch (Exception ex) {
if (debuggedProcess == null || debuggedProcess.HasExited) {
// Process unexpectedly exited
} else {
MessageService.ShowException(ex);
}
}
}

23
src/AddIns/Debugger/Debugger.AddIn/Pads/RunningThreadsPad.cs

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
@ -91,21 +92,13 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -91,21 +92,13 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
return;
}
using(new PrintTimes("Threads refresh")) {
try {
foreach (var t in debuggedProcess.Threads) {
var thread = t;
debuggedProcess.EnqueueWork(Dispatcher.CurrentDispatcher, () => AddThread(thread));
}
} catch(AbortedBecauseDebuggeeResumedException) {
} catch(Exception) {
if (debuggedProcess == null || debuggedProcess.HasExited) {
// Process unexpectedly exited
} else {
throw;
}
}
}
LoggingService.Info("Threads refresh");
debuggedProcess.EnqueueForEach(
Dispatcher.CurrentDispatcher,
debuggedProcess.Threads.ToList(),
t => AddThread(t)
);
}
void RunningThreadsListItemActivate(object sender, EventArgs e)

15
src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs

@ -213,15 +213,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -213,15 +213,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
using(new PrintTimes("Watch Pad refresh")) {
var nodes = watchList.WatchItems.OfType<TreeNodeWrapper>().ToArray();
watchList.WatchItems.Clear();
foreach (var n in nodes) {
var node = n;
debuggedProcess.EnqueueWork(
Dispatcher.CurrentDispatcher,
delegate {
watchList.WatchItems.Add(UpdateNode(node));
}
);
}
debuggedProcess.EnqueueForEach(
Dispatcher.CurrentDispatcher,
nodes,
n => watchList.WatchItems.Add(UpdateNode(n))
);
}
}
}

Loading…
Cancel
Save