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ý 19 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 @@ -95,6 +95,12 @@ namespace ICSharpCode.SharpDevelop.Services
this[3].AllowLabelEdit = variable.Value is PrimitiveValue &&
variable.Value.ManagedType != typeof(string) &&
!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.ShowMinusWhileExpanded = true;

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

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

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

@ -20,7 +20,7 @@ namespace Debugger @@ -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;
}

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

@ -19,6 +19,7 @@ namespace Debugger @@ -19,6 +19,7 @@ namespace Debugger
public class ObjectValue: Value
{
ObjectValueClass topClass;
Variable toStringText;
public override string AsString {
get {
@ -26,8 +27,14 @@ namespace Debugger @@ -26,8 +27,14 @@ namespace Debugger
}
}
public Variable ToStringText {
get {
return toStringText;
}
}
public override string Type {
get{
get {
return topClass.Type;
}
}
@ -67,6 +74,16 @@ namespace Debugger @@ -67,6 +74,16 @@ namespace Debugger
internal ObjectValue(Variable variable):base(variable)
{
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 {

Loading…
Cancel
Save