Browse Source

Update tooltip when debugger is stepped

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2872 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 19 years ago
parent
commit
4d608ba315
  1. 14
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  2. 19
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/Adapters/DynamicTreeDebuggerRow.cs

14
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs

@ -62,6 +62,9 @@ namespace ICSharpCode.SharpDevelop.Services
Debugger.Process debuggedProcess; Debugger.Process debuggedProcess;
DynamicTreeDebuggerRow currentTooltipRow;
Expression currentTooltipExpression;
public event EventHandler<ProcessEventArgs> ProcessSelected; public event EventHandler<ProcessEventArgs> ProcessSelected;
public NDebugger DebuggerCore { public NDebugger DebuggerCore {
@ -291,7 +294,9 @@ namespace ICSharpCode.SharpDevelop.Services
return null; return null;
} else { } else {
try { try {
return new DebuggerGridControl(new DynamicTreeDebuggerRow(DebuggedProcess, new ValueNode(val))); currentTooltipExpression = val.Expression;
currentTooltipRow = new DynamicTreeDebuggerRow(DebuggedProcess, new ValueNode(val));
return new DebuggerGridControl(currentTooltipRow);
} catch (AbortedBecauseDebugeeStateExpiredException) { } catch (AbortedBecauseDebugeeStateExpiredException) {
return null; return null;
} }
@ -473,6 +478,13 @@ namespace ICSharpCode.SharpDevelop.Services
void debuggedProcess_DebuggeeStateChanged(object sender, ProcessEventArgs e) void debuggedProcess_DebuggeeStateChanged(object sender, ProcessEventArgs e)
{ {
JumpToCurrentLine(); JumpToCurrentLine();
if (currentTooltipRow != null && currentTooltipRow.IsShown) {
AbstractNode updatedNode = Debugger.AddIn.TreeModel.Util.CreateNode(currentTooltipExpression);
try {
currentTooltipRow.SetContentRecursive(updatedNode);
} catch (AbortedBecauseDebugeeStateExpiredException) {
}
}
} }
void debuggedProcess_DebuggingResumed(object sender, ProcessEventArgs e) void debuggedProcess_DebuggingResumed(object sender, ProcessEventArgs e)

19
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/Adapters/DynamicTreeDebuggerRow.cs

@ -29,12 +29,22 @@ namespace Debugger.AddIn.TreeModel
AbstractNode content; AbstractNode content;
bool isShown;
bool isExpanded;
bool childsLoaded; bool childsLoaded;
public AbstractNode Content { public AbstractNode Content {
get { return content; } get { return content; }
} }
public bool IsShown {
get { return isShown; }
}
public bool IsExpanded {
get { return isExpanded; }
}
public DynamicTreeDebuggerRow(Process process, AbstractNode content) public DynamicTreeDebuggerRow(Process process, AbstractNode content)
{ {
this.process = process; this.process = process;
@ -45,6 +55,11 @@ namespace Debugger.AddIn.TreeModel
this[3].FinishLabelEdit += OnLabelEdited; this[3].FinishLabelEdit += OnLabelEdited;
this[3].MouseDown += OnMouseDown; this[3].MouseDown += OnMouseDown;
this.Expanded += delegate { isExpanded = true; };
this.Collapsed += delegate { isExpanded = false; };
this.Shown += delegate { isShown = true; };
this.Hidden += delegate { isShown = false; };
SetContentRecursive(content); SetContentRecursive(content);
} }
@ -61,8 +76,10 @@ namespace Debugger.AddIn.TreeModel
this.ShowMinusWhileExpanded = true; this.ShowMinusWhileExpanded = true;
childsLoaded = false; childsLoaded = false;
if (content.ChildNodes != null && this.ChildRows.Count > 0) { if (content.ChildNodes != null && isExpanded) {
LoadChilds(); LoadChilds();
} else {
this.ChildRows.Clear();
} }
// Repaint and process user commands // Repaint and process user commands

Loading…
Cancel
Save