Browse Source

Events unregistered when debugger tooltip is closed

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@901 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
41607e096f
  1. 16
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/TreeListViewDebuggerItem.cs
  2. 34
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DynamicTreeDebuggerRow.cs
  3. 5
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs

16
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/TreeListViewDebuggerItem.cs

@ -44,12 +44,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -44,12 +44,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
{
this.variable = variable;
variable.ValueChanged += delegate {
Highlight = (Variable.Value.AsString != SubItems[1].Text);
Update();
};
variable.ValueChanged += Update;
variable.ValueRemovedFromCollection += delegate { this.Remove(); };
variable.ValueRemovedFromCollection += delegate {
variable.ValueChanged -= Update;
this.Remove();
};
SubItems.Add("");
SubItems.Add("");
@ -57,6 +57,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -57,6 +57,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
Update();
}
void Update(object sender, DebuggerEventArgs e)
{
Highlight = (Variable.Value.AsString != SubItems[1].Text);
Update();
}
public void Update()
{
if (this.SubItems[0].Text != Variable.Name)

34
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DynamicTreeDebuggerRow.cs

@ -26,6 +26,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -26,6 +26,7 @@ namespace ICSharpCode.SharpDevelop.Services
Variable variable;
Image image;
bool populated = false;
public Variable Variable {
get {
@ -45,30 +46,36 @@ namespace ICSharpCode.SharpDevelop.Services @@ -45,30 +46,36 @@ namespace ICSharpCode.SharpDevelop.Services
if (variable == null) throw new ArgumentNullException("variable");
this.variable = variable;
this.variable.ValueChanged += delegate { Update(); };
this.variable.ValueChanged += Update;
this.Hidden += delegate { this.variable.ValueChanged -= Update; };
DebuggerGridControl.AddColumns(this.ChildColumns);
this[1].Paint += OnIconPaint;
this[3].FinishLabelEdit += OnLabelEdited;
if (variable.Value is PrimitiveValue && variable.Value.ManagedType != typeof(string)) {
this[3].AllowLabelEdit = true;
}
if (!variable.Value.MayHaveSubVariables) {
this.ShowPlus = false;
}
this.ShowMinusWhileExpanded = true;
Update();
}
void Update(object sender, DebuggerEventArgs e)
{
Update();
}
void Update()
{
image = DebuggerIcons.GetImage(variable);
this[1].Text = ""; // Icon
this[2].Text = variable.Name;
this[3].Text = variable.Value.AsString;
if (variable.Value is PrimitiveValue && variable.Value.ManagedType != typeof(string)) {
this[3].AllowLabelEdit = true;
}
if (!variable.Value.MayHaveSubVariables) {
this.ShowPlus = false;
}
this.ShowMinusWhileExpanded = true;
}
void OnIconPaint(object sender, ItemPaintEventArgs e)
@ -94,6 +101,13 @@ namespace ICSharpCode.SharpDevelop.Services @@ -94,6 +101,13 @@ namespace ICSharpCode.SharpDevelop.Services
/// Sets the data to be show in the next level.
/// </summary>
protected override void OnExpanding(DynamicListEventArgs e)
{
if (!populated) {
Populate();
}
}
void Populate()
{
List<Variable> publicStatic = new List<Variable>();
List<Variable> publicInstance = new List<Variable>();
@ -137,6 +151,8 @@ namespace ICSharpCode.SharpDevelop.Services @@ -137,6 +151,8 @@ namespace ICSharpCode.SharpDevelop.Services
}
// Public Members
this.ChildRows.AddRange(RowsFromVariables(publicInstance));
populated = true;
}
IEnumerable<DynamicListRow> RowsFromVariables(IEnumerable<Variable> variables)

5
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs

@ -239,7 +239,7 @@ namespace Debugger @@ -239,7 +239,7 @@ namespace Debugger
internal IEnumerable<Function> GetCallstackAt(uint firstChainIndex, uint firstFrameIndex)
{
if (process.IsRunning) yield break; // TODO: thow exception
process.AssertPaused();
ICorDebugChainEnum corChainEnum;
corThread.EnumerateChains(out corChainEnum);
@ -265,6 +265,9 @@ namespace Debugger @@ -265,6 +265,9 @@ namespace Debugger
chainIndex--;
CorDebugChainReason reason;
corChains[0].GetReason(out reason);
int isManaged;
corChains[0].IsManaged(out isManaged);
if (isManaged == 0) continue; // Only managed ones

Loading…
Cancel
Save