Browse Source

Show ToString() text in tooltip

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1692 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
738bbd243f
  1. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DynamicTreeDebuggerRow.cs
  2. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs
  3. 14
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Process.cs
  4. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ProcessEventArgs.cs
  5. 19
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ObjectValue.cs

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

@ -95,6 +95,12 @@ namespace ICSharpCode.SharpDevelop.Services
this[3].AllowLabelEdit = variable.Value is PrimitiveValue && this[3].AllowLabelEdit = variable.Value is PrimitiveValue &&
variable.Value.ManagedType != typeof(string) && variable.Value.ManagedType != typeof(string) &&
!ShowValuesInHexadecimal; !ShowValuesInHexadecimal;
ObjectValue objValue = variable.Value as ObjectValue;
if (objValue != null) {
objValue.ToStringText.Changed -= Update;
objValue.ToStringText.Changed += Update;
this[3].Text = objValue.ToStringText.Value.AsString;
}
this.ShowPlus = variable.Value.MayHaveSubVariables; this.ShowPlus = variable.Value.MayHaveSubVariables;
this.ShowMinusWhileExpanded = true; this.ShowMinusWhileExpanded = true;

6
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs

@ -130,17 +130,17 @@ namespace Debugger
/// </summary> /// </summary>
public event EventHandler<MessageEventArgs> DebuggerTraceMessage; public event EventHandler<MessageEventArgs> DebuggerTraceMessage;
protected internal virtual void OnDebuggerTraceMessage(string message) protected internal virtual void OnDebuggerTraceMessage(MessageEventArgs e)
{ {
if (DebuggerTraceMessage != null) { if (DebuggerTraceMessage != null) {
DebuggerTraceMessage(this, new MessageEventArgs(null, message)); DebuggerTraceMessage(this, e);
} }
} }
internal void TraceMessage(string message) internal void TraceMessage(string message)
{ {
System.Diagnostics.Debug.WriteLine("Debugger:" + message); System.Diagnostics.Debug.WriteLine("Debugger:" + message);
OnDebuggerTraceMessage(message); OnDebuggerTraceMessage(new MessageEventArgs(null, message));
} }
public void StartWithoutDebugging(System.Diagnostics.ProcessStartInfo psi) public void StartWithoutDebugging(System.Diagnostics.ProcessStartInfo psi)

14
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Process.cs

@ -216,22 +216,10 @@ namespace Debugger
} }
} }
/// <summary>
/// Internal: Used to debug the debugger library.
/// </summary>
public event EventHandler<MessageEventArgs> DebuggerTraceMessage;
protected internal virtual void OnDebuggerTraceMessage(string message)
{
if (DebuggerTraceMessage != null) {
DebuggerTraceMessage(this, new MessageEventArgs(this, message));
}
}
internal void TraceMessage(string message) internal void TraceMessage(string message)
{ {
System.Diagnostics.Debug.WriteLine("Debugger:" + message); System.Diagnostics.Debug.WriteLine("Debugger:" + message);
OnDebuggerTraceMessage(message); debugger.OnDebuggerTraceMessage(new MessageEventArgs(this, message));
} }
public SourcecodeSegment NextStatement { public SourcecodeSegment NextStatement {

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ProcessEventArgs.cs

@ -20,7 +20,7 @@ namespace Debugger
} }
} }
public ProcessEventArgs(Process process): base(process.Debugger) public ProcessEventArgs(Process process): base(process == null ? null : process.Debugger)
{ {
this.process = process; this.process = process;
} }

19
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ObjectValue.cs

@ -19,6 +19,7 @@ namespace Debugger
public class ObjectValue: Value public class ObjectValue: Value
{ {
ObjectValueClass topClass; ObjectValueClass topClass;
Variable toStringText;
public override string AsString { public override string AsString {
get { get {
@ -26,8 +27,14 @@ namespace Debugger
} }
} }
public Variable ToStringText {
get {
return toStringText;
}
}
public override string Type { public override string Type {
get{ get {
return topClass.Type; return topClass.Type;
} }
} }
@ -67,6 +74,16 @@ namespace Debugger
internal ObjectValue(Variable variable):base(variable) internal ObjectValue(Variable variable):base(variable)
{ {
topClass = new ObjectValueClass(this, this.CorValue.As<ICorDebugObjectValue>().Class); topClass = new ObjectValueClass(this, this.CorValue.As<ICorDebugObjectValue>().Class);
Module module = GetClass("System.Object").Module;
ICorDebugFunction corFunction = module.GetMethod("System.Object", "ToString", 0);
toStringText = new CallFunctionEval(this.Process,
"ToString()",
Variable.Flags.Default,
new IExpirable[] {this.Variable},
new IMutable[] {this.Variable},
corFunction,
this.Variable,
new Variable[] {});
} }
internal bool IsCorValueCompatible { internal bool IsCorValueCompatible {

Loading…
Cancel
Save