Browse Source

Renamed debugger Variables to Values

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@742 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
6f785e7cc0
  1. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs
  2. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs
  3. 8
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/VariableListItems/BaseClassItem.cs
  4. 14
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/VariableListItems/VariableItem.cs
  5. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DynamicTreeDebuggerRow.cs
  6. 8
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  7. 28
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj
  8. 10
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Exception.cs
  9. 16
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs
  10. 20
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs
  11. 18
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ArrayValue.cs
  12. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs
  13. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/EvalEventArgs.cs
  14. 14
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/MagicValue.cs
  15. 8
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/NullValue.cs
  16. 22
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ObjectValue.cs
  17. 18
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/PrimitiveValue.cs
  18. 16
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/PropertyVariable.cs
  19. 8
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/UnavailableValue.cs
  20. 8
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/UnknownValue.cs
  21. 18
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Value.cs
  22. 14
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ValueEventArgs.cs
  23. 20
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ValueFactory.cs
  24. 50
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableCollection.cs

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -219,7 +219,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -219,7 +219,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
}
if (showArgumentValues) {
try {
argValue = f.GetArgumentVariable(i).Value.ToString();
argValue = f.GetArgumentVariable(i).AsString.ToString();
} catch { }
}
if (parameterName != null && argValue != null) {

6
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -128,7 +128,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -128,7 +128,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
}
}
static VariableItem FindVariableItem(TreeListViewItemCollection items, Variable variable)
static VariableItem FindVariableItem(TreeListViewItemCollection items, Value variable)
{
foreach (VariableListItem item in items) {
VariableItem variableItem = item as VariableItem;
@ -142,7 +142,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -142,7 +142,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
public static void UpdateVariables(TreeListViewItemCollection items, VariableCollection variables)
{
// Add new variables and refresh existing ones
foreach (Variable variable in variables) {
foreach (Value variable in variables) {
VariableItem item = FindVariableItem(items, variable);
if (item != null) {
item.Variable = variable;

8
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/VariableListItems/BaseClassItem.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -14,9 +14,9 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -14,9 +14,9 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
{
class BaseClassItem: VariableItem
{
public BaseClassItem(Variable uncastedVariable)
public BaseClassItem(Value uncastedVariable)
{
ObjectVariable variable = uncastedVariable as ObjectVariable;
ObjectValue variable = uncastedVariable as ObjectValue;
if (variable != null && variable.HasBaseClass && variable.BaseClass.Type != "System.Object") {
this.Variable = variable.BaseClass;
} else {
@ -32,7 +32,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -32,7 +32,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
}
SetTexts("<Base class>",
Variable.Value.ToString(),
Variable.AsString.ToString(),
Variable.Type);
ImageIndex = 0; // Class

14
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/VariableListItems/VariableItem.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -15,11 +15,11 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -15,11 +15,11 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
{
class VariableItem: VariableListItem
{
Variable variable;
Value variable;
bool baseClassItemAdded = false;
public Variable Variable {
public Value Variable {
get {
return variable;
}
@ -40,7 +40,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -40,7 +40,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
}
public VariableItem(Variable variable): base()
public VariableItem(Value variable): base()
{
this.variable = variable;
Refresh();
@ -58,10 +58,10 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -58,10 +58,10 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
}
SetTexts(variable.Name,
variable.Value.ToString(),
variable.AsString.ToString(),
variable.Type);
if (variable is ObjectVariable) {
if (variable is ObjectValue) {
ImageIndex = 0; // Class
} else if (variable is PropertyVariable){
ImageIndex = 2; // Property
@ -88,7 +88,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -88,7 +88,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
}
// Do not sort names of array items
if (Variable is ArrayVariable) {
if (Variable is ArrayValue) {
this.Items.SortOrder = SortOrder.None;
} else {
this.Items.SortOrder = SortOrder.Ascending;

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

@ -19,9 +19,9 @@ namespace ICSharpCode.SharpDevelop.Services @@ -19,9 +19,9 @@ namespace ICSharpCode.SharpDevelop.Services
// 2 = text
// 3 = value
Variable variable;
Value variable;
public Variable Variable {
public Value Variable {
get {
return variable;
}
@ -34,7 +34,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -34,7 +34,7 @@ namespace ICSharpCode.SharpDevelop.Services
{
}
public DynamicTreeDebuggerRow(Variable variable)
public DynamicTreeDebuggerRow(Value variable)
{
if (variable == null) throw new ArgumentNullException("variable");

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

@ -195,7 +195,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -195,7 +195,7 @@ namespace ICSharpCode.SharpDevelop.Services
/// Gets variable of given name.
/// Returns null if unsuccessful.
/// </summary>
public Variable GetVariableFromName(string variableName)
public Value GetVariableFromName(string variableName)
{
if (debugger == null || debugger.IsRunning) return null;
@ -217,7 +217,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -217,7 +217,7 @@ namespace ICSharpCode.SharpDevelop.Services
/// </summary>
public string GetValueAsString(string variableName)
{
Variable variable = GetVariableFromName(variableName);
Value variable = GetVariableFromName(variableName);
if (variable == null) {
return null;
@ -232,7 +232,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -232,7 +232,7 @@ namespace ICSharpCode.SharpDevelop.Services
/// </summary>
public DebuggerGridControl GetTooltipControl(string variableName)
{
Variable variable = GetVariableFromName(variableName);
Value variable = GetVariableFromName(variableName);
if (variable == null) {
return null;
@ -251,7 +251,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -251,7 +251,7 @@ namespace ICSharpCode.SharpDevelop.Services
{
DynamicTreeDebuggerRow row = (DynamicTreeDebuggerRow) sender;
row.ChildRows.Clear();
foreach(Variable variable in row.Variable.SubVariables) {
foreach(Value variable in row.Variable.SubVariables) {
DynamicTreeDebuggerRow newRow = new DynamicTreeDebuggerRow(variable);
DebuggerGridControl.AddColumns(newRow.ChildColumns);
newRow.Expanding += TooltipControlRowExpanding;

28
src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj

@ -86,17 +86,6 @@ @@ -86,17 +86,6 @@
<Compile Include="Src\Threads\SourcecodeSegment.cs" />
<Compile Include="Src\Threads\Thread.cs" />
<Compile Include="Src\Threads\ThreadEventArgs.cs" />
<Compile Include="Src\Variables\ArrayVariable.cs" />
<Compile Include="Src\Variables\BuiltInVariable.cs" />
<Compile Include="Src\Variables\Evals\Eval.cs" />
<Compile Include="Src\Variables\NullRefVariable.cs" />
<Compile Include="Src\Variables\ObjectVariable.cs" />
<Compile Include="Src\Variables\PropertyVariable.cs" />
<Compile Include="Src\Variables\SignatureStream.cs" />
<Compile Include="Src\Variables\UnknownVariable.cs" />
<Compile Include="Src\Variables\Variable.cs" />
<Compile Include="Src\Variables\VariableCollection.cs" />
<Compile Include="Src\Variables\VariableFactory.cs" />
<Compile Include="Src\RemotingSinks\InvokeOnSTASink\InvokeOnSTAServerChannelSinkProvider.cs" />
<Compile Include="Src\RemotingSinks\InvokeOnSTASink\InvokeOnSTAClientChannelSink.cs" />
<Compile Include="Src\RemotingSinks\InvokeOnSTASink\InvokeOnSTAClientChannelSinkProvider.cs" />
@ -105,7 +94,6 @@ @@ -105,7 +94,6 @@
<Compile Include="Src\RemotingSinks\PrivateEventHandlersSink\EventForwarder.cs" />
<Compile Include="Src\RemotingSinks\PrivateEventHandlersSink\PrivateEventHandlersClientChannelSink.cs" />
<Compile Include="Src\Debugger\NDebugger-StateControl.cs" />
<Compile Include="Src\Variables\UnavailableVariable.cs" />
<Compile Include="Src\Interop\CorDebug\_COR_IL_MAP.cs" />
<Compile Include="Src\Interop\CorDebug\_COR_VERSION.cs" />
<Compile Include="Src\Interop\CorDebug\_FILETIME.cs" />
@ -201,10 +189,22 @@ @@ -201,10 +189,22 @@
<Compile Include="Src\Interop\CorDebug\tagSTATSTG.cs" />
<Compile Include="Src\Interop\MetaData\IMetaDataImport.cs" />
<Compile Include="Src\Interop\MetaData\COR_FIELD_OFFSET.cs" />
<Compile Include="Src\Variables\Evals\Eval.cs" />
<Compile Include="Src\Variables\Evals\EvalEventArgs.cs" />
<Compile Include="Src\Variables\Evals\NDebugger-Evals.cs" />
<Compile Include="Src\Variables\VariableEventArgs.cs" />
<Compile Include="Src\Variables\VariableMagicValue.cs" />
<Compile Include="Src\Variables\ArrayValue.cs" />
<Compile Include="Src\Variables\MagicValue.cs" />
<Compile Include="Src\Variables\NullValue.cs" />
<Compile Include="Src\Variables\ObjectValue.cs" />
<Compile Include="Src\Variables\PrimitiveValue.cs" />
<Compile Include="Src\Variables\PropertyVariable.cs" />
<Compile Include="Src\Variables\SignatureStream.cs" />
<Compile Include="Src\Variables\UnavailableValue.cs" />
<Compile Include="Src\Variables\UnknownValue.cs" />
<Compile Include="Src\Variables\Value.cs" />
<Compile Include="Src\Variables\ValueEventArgs.cs" />
<Compile Include="Src\Variables\ValueFactory.cs" />
<Compile Include="Src\Variables\VariableCollection.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="README.TXT" />

10
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Exception.cs

@ -20,8 +20,8 @@ namespace Debugger @@ -20,8 +20,8 @@ namespace Debugger
NDebugger debugger;
Thread thread;
ICorDebugValue corValue;
Variable runtimeVariable;
ObjectVariable runtimeVariableException;
Value runtimeVariable;
ObjectValue runtimeVariableException;
ExceptionType exceptionType;
SourcecodeSegment location;
DateTime creationTime;
@ -42,8 +42,8 @@ namespace Debugger @@ -42,8 +42,8 @@ namespace Debugger
this.thread = thread;
thread.CorThread.GetCurrentException(out corValue);
exceptionType = thread.CurrentExceptionType;
runtimeVariable = VariableFactory.CreateVariable(debugger, corValue, "$exception");
runtimeVariableException = runtimeVariable as ObjectVariable;
runtimeVariable = ValueFactory.CreateValue(debugger, corValue, "$exception");
runtimeVariableException = runtimeVariable as ObjectValue;
if (runtimeVariableException != null) {
while (runtimeVariableException.Type != "System.Exception") {
if (runtimeVariableException.HasBaseClass == false) {
@ -52,7 +52,7 @@ namespace Debugger @@ -52,7 +52,7 @@ namespace Debugger
}
runtimeVariableException = runtimeVariableException.BaseClass;
}
message = runtimeVariableException.SubVariables["_message"].Value.ToString();
message = runtimeVariableException.SubVariables["_message"].AsString.ToString();
}
if (thread.LastFunctionWithLoadedSymbols != null) {

16
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs

@ -65,14 +65,14 @@ namespace Debugger @@ -65,14 +65,14 @@ namespace Debugger
}
}
public ObjectVariable ThisVariable {
public ObjectValue ThisValue {
get {
if (IsStatic) {
throw new DebuggerException("Static method does not have 'this' variable.");
throw new DebuggerException("Static method does not have 'this'.");
} else {
ICorDebugValue argThis = null;
corILFrame.GetArgument(0, out argThis);
return new ObjectVariable(debugger, argThis, "this", ContaingClass);
return new ObjectValue(debugger, argThis, "this", ContaingClass);
}
}
}
@ -376,7 +376,7 @@ namespace Debugger @@ -376,7 +376,7 @@ namespace Debugger
if (IsStatic) {
return VariableCollection.Empty;
} else {
return ThisVariable.SubVariables;
return ThisValue.SubVariables;
}
}
@ -411,9 +411,9 @@ namespace Debugger @@ -411,9 +411,9 @@ namespace Debugger
return arg;
}
public Variable GetArgumentVariable(int index)
public Value GetArgumentVariable(int index)
{
return VariableFactory.CreateVariable(debugger, GetArgumentValue(index), GetParameterName(index));
return ValueFactory.CreateValue(debugger, GetArgumentValue(index), GetParameterName(index));
}
public VariableCollection GetArgumentVariables()
@ -451,7 +451,7 @@ namespace Debugger @@ -451,7 +451,7 @@ namespace Debugger
if (IsStatic) {
evalArgs = new ICorDebugValue[0];
} else {
evalArgs = new ICorDebugValue[] {ThisVariable.CorValue};
evalArgs = new ICorDebugValue[] {ThisValue.CorValue};
}
Eval eval = new Eval(debugger, evalCorFunction, evalArgs);
debugger.AddEval(eval);
@ -476,7 +476,7 @@ namespace Debugger @@ -476,7 +476,7 @@ namespace Debugger
{
ICorDebugValue runtimeVar;
corILFrame.GetLocalVariable((uint)symVar.AddressField1, out runtimeVar);
collection.Add(VariableFactory.CreateVariable(debugger, runtimeVar, symVar.Name));
collection.Add(ValueFactory.CreateValue(debugger, runtimeVar, symVar.Name));
}
}
}

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

@ -107,21 +107,21 @@ namespace Debugger @@ -107,21 +107,21 @@ namespace Debugger
if (!HasBeenLoaded) return lastPriority;
if (process.IsRunning) return lastPriority;
Variable runTimeVar = RuntimeVariable;
if (runTimeVar is NullRefVariable) return ThreadPriority.Normal;
lastPriority = (ThreadPriority)(int)(runTimeVar.SubVariables["m_Priority"] as BuiltInVariable).Value;
Value runTimeVar = RuntimeVariable;
if (runTimeVar is NullValue) return ThreadPriority.Normal;
lastPriority = (ThreadPriority)(int)(runTimeVar.SubVariables["m_Priority"] as PrimitiveValue).Primitive;
return lastPriority;
}
}
public Variable RuntimeVariable {
public Value RuntimeVariable {
get {
if (!HasBeenLoaded) throw new DebuggerException("Thread has not started jet");
process.AssertPaused();
ICorDebugValue corValue;
corThread.GetObject(out corValue);
return VariableFactory.CreateVariable(debugger, corValue, "Thread" + ID);
return ValueFactory.CreateValue(debugger, corValue, "Thread" + ID);
}
}
@ -129,11 +129,11 @@ namespace Debugger @@ -129,11 +129,11 @@ namespace Debugger
get {
if (!HasBeenLoaded) return lastName;
if (process.IsRunning) return lastName;
Variable runtimeVar = RuntimeVariable;
if (runtimeVar is NullRefVariable) return lastName;
Variable runtimeName = runtimeVar.SubVariables["m_Name"];
if (runtimeName is NullRefVariable) return string.Empty;
lastName = runtimeName.Value.ToString();
Value runtimeVar = RuntimeVariable;
if (runtimeVar is NullValue) return lastName;
Value runtimeName = runtimeVar.SubVariables["m_Name"];
if (runtimeName is NullValue) return string.Empty;
lastName = runtimeName.AsString.ToString();
return lastName;
}
}

18
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ArrayVariable.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ArrayValue.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -15,7 +15,7 @@ using Debugger.Interop.CorDebug; @@ -15,7 +15,7 @@ using Debugger.Interop.CorDebug;
namespace Debugger
{
public class ArrayVariable: Variable
public class ArrayValue: Value
{
ICorDebugArrayValue corArrayValue;
uint[] dimensions;
@ -43,7 +43,7 @@ namespace Debugger @@ -43,7 +43,7 @@ namespace Debugger
}
}
public override object Value {
public override string AsString {
get {
string txt = "{" + ElementsType + "[";
for (int i = 0; i < rank; i++)
@ -54,7 +54,7 @@ namespace Debugger @@ -54,7 +54,7 @@ namespace Debugger
}
internal unsafe ArrayVariable(NDebugger debugger, ICorDebugValue corValue, string name):base(debugger, corValue, name)
internal unsafe ArrayValue(NDebugger debugger, ICorDebugValue corValue, string name):base(debugger, corValue, name)
{
corArrayValue = (ICorDebugArrayValue)this.corValue;
uint corElementTypeRaw;
@ -70,25 +70,25 @@ namespace Debugger @@ -70,25 +70,25 @@ namespace Debugger
}
public Variable this[uint index] {
public Value this[uint index] {
get {
return this[new uint[] {index}];
}
}
public Variable this[uint index1, uint index2] {
public Value this[uint index1, uint index2] {
get {
return this[new uint[] {index1, index2}];
}
}
public Variable this[uint index1, uint index2, uint index3] {
public Value this[uint index1, uint index2, uint index3] {
get {
return this[new uint[] {index1, index2, index3}];
}
}
public unsafe Variable this[uint[] indices] {
public unsafe Value this[uint[] indices] {
get {
if (indices.Length != rank) throw new DebuggerException("Given indicies does not match array size.");
@ -101,7 +101,7 @@ namespace Debugger @@ -101,7 +101,7 @@ namespace Debugger
fixed (void* pIndices = indices)
corArrayValue.GetElement(rank, new IntPtr(pIndices), out element);
return VariableFactory.CreateVariable(debugger, element, elementName);
return ValueFactory.CreateValue(debugger, element, elementName);
}
}

6
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs

@ -28,7 +28,7 @@ namespace Debugger @@ -28,7 +28,7 @@ namespace Debugger
bool evaluating = false;
bool completed = false;
Variable result;
Value result;
public event EventHandler<EvalEventArgs> EvalStarted;
public event EventHandler<EvalEventArgs> EvalComplete;
@ -63,7 +63,7 @@ namespace Debugger @@ -63,7 +63,7 @@ namespace Debugger
/// <summary>
/// The result of the evaluation if the evaluation is complete and has returned a value. Null otherwise.
/// </summary>
public Variable Result {
public Value Result {
get {
if (completed) {
return result;
@ -117,7 +117,7 @@ namespace Debugger @@ -117,7 +117,7 @@ namespace Debugger
ICorDebugValue corValue;
corEval.GetResult(out corValue);
result = VariableFactory.CreateVariable(debugger, corValue, "eval result");
result = ValueFactory.CreateValue(debugger, corValue, "eval result");
if (EvalComplete != null) {
EvalComplete(this, e);

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/EvalEventArgs.cs

@ -20,7 +20,7 @@ namespace Debugger @@ -20,7 +20,7 @@ namespace Debugger
}
}
public Variable Result {
public Value Result {
get {
return eval.Result;
}

14
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableMagicValue.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/MagicValue.cs

@ -12,27 +12,27 @@ namespace Debugger @@ -12,27 +12,27 @@ namespace Debugger
/// <summary>
/// This value may be returned by Variable.Value instead of null to provide some additional information.
/// </summary>
public class VariableMagicValue
public class MagicValue
{
object @value;
object val;
public object Value {
get {
return @value;
return val;
}
set {
this.@value = value;
this.val = value;
}
}
public VariableMagicValue(object @value)
public MagicValue(object val)
{
this.@value = @value;
this.val = val;
}
public override string ToString()
{
return @value.ToString();
return val.ToString();
}
}
}

8
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/NullRefVariable.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/NullValue.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -12,9 +12,9 @@ using Debugger.Interop.CorDebug; @@ -12,9 +12,9 @@ using Debugger.Interop.CorDebug;
namespace Debugger
{
public class NullRefVariable: Variable
public class NullValue: Value
{
public override object Value {
public override string AsString {
get {
return "<null reference>";
}
@ -36,7 +36,7 @@ namespace Debugger @@ -36,7 +36,7 @@ namespace Debugger
}
}
internal unsafe NullRefVariable(NDebugger debugger, ICorDebugValue corValue, string name):base(debugger, corValue, name)
internal unsafe NullValue(NDebugger debugger, ICorDebugValue corValue, string name):base(debugger, corValue, name)
{
}

22
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ObjectVariable.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ObjectValue.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -15,17 +15,17 @@ using Debugger.Interop.MetaData; @@ -15,17 +15,17 @@ using Debugger.Interop.MetaData;
namespace Debugger
{
public class ObjectVariable: Variable
public class ObjectValue: Value
{
ICorDebugClass corClass;
ICorDebugModule corModule;
MetaData metaData;
ICorDebugModule corModuleSuperclass;
ObjectVariable baseClass;
ObjectValue baseClass;
TypeDefProps classProps;
public override object Value {
public override string AsString {
get{
return "{" + Type + "}";
}
@ -38,13 +38,13 @@ namespace Debugger @@ -38,13 +38,13 @@ namespace Debugger
}
internal unsafe ObjectVariable(NDebugger debugger, ICorDebugValue corValue, string name):base(debugger, corValue, name)
internal unsafe ObjectValue(NDebugger debugger, ICorDebugValue corValue, string name):base(debugger, corValue, name)
{
((ICorDebugObjectValue)this.corValue).GetClass(out corClass);
InitObjectVariable();
}
internal unsafe ObjectVariable(NDebugger debugger, ICorDebugValue corValue, string name, ICorDebugClass corClass):base(debugger, corValue, name)
internal unsafe ObjectValue(NDebugger debugger, ICorDebugValue corValue, string name, ICorDebugClass corClass):base(debugger, corValue, name)
{
this.corClass = corClass;
InitObjectVariable();
@ -94,16 +94,16 @@ namespace Debugger @@ -94,16 +94,16 @@ namespace Debugger
((ICorDebugObjectValue)corValue).GetFieldValue(corClass, field.Token, out fieldValue);
}
subVariables.Add(VariableFactory.CreateVariable(debugger, fieldValue, field.Name));
subVariables.Add(ValueFactory.CreateValue(debugger, fieldValue, field.Name));
} catch {
subVariables.Add(new UnavailableVariable(debugger, null, field.Name));
subVariables.Add(new UnavailableValue(debugger, null, field.Name));
}
}
return subVariables;
}
public unsafe ObjectVariable BaseClass {
public unsafe ObjectValue BaseClass {
get {
if (baseClass == null) baseClass = GetBaseClass();
if (baseClass == null) throw new DebuggerException("Object doesn't have a base class. You may use HasBaseClass to check this.");
@ -124,7 +124,7 @@ namespace Debugger @@ -124,7 +124,7 @@ namespace Debugger
}
}
protected ObjectVariable GetBaseClass()
protected ObjectValue GetBaseClass()
{
string fullTypeName = "<>";
@ -155,7 +155,7 @@ namespace Debugger @@ -155,7 +155,7 @@ namespace Debugger
} else {
ICorDebugClass superClass;
corModuleSuperclass.GetClassFromToken(classProps.SuperClassToken, out superClass);
return new ObjectVariable(debugger, corValue, Name, superClass);
return new ObjectValue(debugger, corValue, Name, superClass);
}
}
}

18
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/BuiltInVariable.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/PrimitiveValue.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -12,9 +12,19 @@ using Debugger.Interop.CorDebug; @@ -12,9 +12,19 @@ using Debugger.Interop.CorDebug;
namespace Debugger
{
public class BuiltInVariable: Variable
public class PrimitiveValue: Value
{
public override unsafe object Value
public override string AsString {
get {
if (Primitive != null) {
return Primitive.ToString();
} else {
return String.Empty;
}
}
}
public unsafe object Primitive
{
get
{
@ -69,7 +79,7 @@ namespace Debugger @@ -69,7 +79,7 @@ namespace Debugger
}
}
internal BuiltInVariable(NDebugger debugger, ICorDebugValue corValue, string name):base(debugger, corValue, name)
internal PrimitiveValue(NDebugger debugger, ICorDebugValue corValue, string name):base(debugger, corValue, name)
{
}

16
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/PropertyVariable.cs

@ -11,7 +11,7 @@ using Debugger.Interop.CorDebug; @@ -11,7 +11,7 @@ using Debugger.Interop.CorDebug;
namespace Debugger
{
public class PropertyVariable: Variable
public class PropertyVariable: Value
{
Eval eval;
@ -30,19 +30,19 @@ namespace Debugger @@ -30,19 +30,19 @@ namespace Debugger
}
}
public override object Value {
public override string AsString {
get {
if (IsEvaluated) {
if (eval.Result != null) {
return eval.Result.Value;
return eval.Result.AsString;
} else {
return null;
return String.Empty;
}
} else {
if (eval.Evaluating) {
return new VariableMagicValue("Evaluating...");
return "Evaluating...";
} else {
return new VariableMagicValue("Evaluation pending");
return "Evaluation pending";
}
}
}
@ -91,7 +91,7 @@ namespace Debugger @@ -91,7 +91,7 @@ namespace Debugger
void EvalStarted(object sender, EvalEventArgs args)
{
OnValueChanged(new VariableEventArgs(this));
OnValueChanged(new ValueEventArgs(this));
}
void EvalComplete(object sender, EvalEventArgs args)
@ -100,7 +100,7 @@ namespace Debugger @@ -100,7 +100,7 @@ namespace Debugger
eval.Result.Name = this.Name;
}
OnValueEvaluated();
OnValueChanged(new VariableEventArgs(this));
OnValueChanged(new ValueEventArgs(this));
}
protected void OnValueEvaluated()

8
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/UnavailableVariable.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/UnavailableValue.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -12,9 +12,9 @@ using Debugger.Interop.CorDebug; @@ -12,9 +12,9 @@ using Debugger.Interop.CorDebug;
namespace Debugger
{
public class UnavailableVariable: Variable
public class UnavailableValue: Value
{
public override object Value {
public override string AsString {
get {
return "<unavailable>";
}
@ -26,7 +26,7 @@ namespace Debugger @@ -26,7 +26,7 @@ namespace Debugger
}
}
internal unsafe UnavailableVariable(NDebugger debugger, ICorDebugValue corValue, string name):base(debugger, corValue, name)
internal unsafe UnavailableValue(NDebugger debugger, ICorDebugValue corValue, string name):base(debugger, corValue, name)
{
}

8
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/UnknownVariable.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/UnknownValue.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -12,9 +12,9 @@ using Debugger.Interop.CorDebug; @@ -12,9 +12,9 @@ using Debugger.Interop.CorDebug;
namespace Debugger
{
public class UnknownVariable: Variable
public class UnknownValue: Value
{
public override object Value {
public override string AsString {
get {
return "<unknown>";
}
@ -26,7 +26,7 @@ namespace Debugger @@ -26,7 +26,7 @@ namespace Debugger
}
}
internal unsafe UnknownVariable(NDebugger debugger, ICorDebugValue corValue, string name):base(debugger, corValue, name)
internal unsafe UnknownValue(NDebugger debugger, ICorDebugValue corValue, string name):base(debugger, corValue, name)
{
}

18
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Variable.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Value.cs

@ -12,7 +12,7 @@ using Debugger.Interop.CorDebug; @@ -12,7 +12,7 @@ using Debugger.Interop.CorDebug;
namespace Debugger
{
public abstract class Variable: RemotingObjectBase
public abstract class Value: RemotingObjectBase
{
protected NDebugger debugger;
@ -21,7 +21,7 @@ namespace Debugger @@ -21,7 +21,7 @@ namespace Debugger
VariableCollection subVariables;
CorElementType? corType;
public event EventHandler<VariableEventArgs> ValueChanged;
public event EventHandler<ValueEventArgs> ValueChanged;
public NDebugger Debugger {
get {
@ -29,7 +29,7 @@ namespace Debugger @@ -29,7 +29,7 @@ namespace Debugger
}
}
protected virtual void OnValueChanged(VariableEventArgs e)
protected virtual void OnValueChanged(ValueEventArgs e)
{
if (ValueChanged != null) {
ValueChanged(this, e);
@ -51,7 +51,7 @@ namespace Debugger @@ -51,7 +51,7 @@ namespace Debugger
}
}
public abstract object Value {
public abstract string AsString {
get;
}
@ -81,7 +81,7 @@ namespace Debugger @@ -81,7 +81,7 @@ namespace Debugger
}
}
internal Variable(NDebugger debugger, ICorDebugValue corValue, string name)
internal Value(NDebugger debugger, ICorDebugValue corValue, string name)
{
this.debugger = debugger;
if (corValue != null) {
@ -99,12 +99,12 @@ namespace Debugger @@ -99,12 +99,12 @@ namespace Debugger
{
//return String.Format("Name = {0,-25} Value = {1,-30} Type = {2,-30}", Name, Value, Type);
if (Value == null) {
if (AsString == null) {
return "<null>";
} else if (Value is string) {
return "\"" + Value.ToString() + "\"";
} else if (AsString is string) {
return "\"" + AsString.ToString() + "\"";
} else {
return Value.ToString();
return AsString.ToString();
}
}

14
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableEventArgs.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ValueEventArgs.cs

@ -10,22 +10,22 @@ using System; @@ -10,22 +10,22 @@ using System;
namespace Debugger
{
[Serializable]
public class VariableEventArgs : DebuggerEventArgs
public class ValueEventArgs : DebuggerEventArgs
{
Variable variable;
Value val;
public Variable Variable {
public Value Value {
get {
return variable;
return val;
}
set {
variable = value;
val = value;
}
}
public VariableEventArgs(Variable variable): base(variable.Debugger)
public ValueEventArgs(Value val): base(val.Debugger)
{
this.variable = variable;
this.val = val;
}
}
}

20
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableFactory.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ValueFactory.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -11,15 +11,15 @@ using Debugger.Interop.CorDebug; @@ -11,15 +11,15 @@ using Debugger.Interop.CorDebug;
namespace Debugger
{
static class VariableFactory
static class ValueFactory
{
public static Variable CreateVariable(NDebugger debugger, ICorDebugValue corValue, string name)
public static Value CreateValue(NDebugger debugger, ICorDebugValue corValue, string name)
{
CorElementType type = Variable.GetCorType(corValue);
CorElementType type = Value.GetCorType(corValue);
if (Variable.DereferenceUnbox(corValue) == null)
if (Value.DereferenceUnbox(corValue) == null)
{
return new NullRefVariable(debugger, corValue, name);
return new NullValue(debugger, corValue, name);
}
switch(type)
@ -39,19 +39,19 @@ namespace Debugger @@ -39,19 +39,19 @@ namespace Debugger
case CorElementType.I:
case CorElementType.U:
case CorElementType.STRING:
return new BuiltInVariable(debugger, corValue, name);
return new PrimitiveValue(debugger, corValue, name);
case CorElementType.ARRAY:
case CorElementType.SZARRAY: // Short-cut for single dimension zero lower bound array
return new ArrayVariable(debugger, corValue, name);
return new ArrayValue(debugger, corValue, name);
case CorElementType.VALUETYPE:
case CorElementType.CLASS:
case CorElementType.OBJECT: // Short-cut for Class "System.Object"
return new ObjectVariable(debugger, corValue, name);
return new ObjectValue(debugger, corValue, name);
default: // Unknown type
return new UnknownVariable(debugger, corValue, name);
return new UnknownValue(debugger, corValue, name);
}
}
}

50
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableCollection.cs

@ -19,8 +19,8 @@ namespace Debugger @@ -19,8 +19,8 @@ namespace Debugger
bool readOnly = false;
public event EventHandler<VariableEventArgs> VariableAdded;
public event EventHandler<VariableEventArgs> VariableRemoved;
public event EventHandler<ValueEventArgs> VariableAdded;
public event EventHandler<ValueEventArgs> VariableRemoved;
internal event EventHandler Updating;
internal VariableCollection()
@ -45,9 +45,9 @@ namespace Debugger @@ -45,9 +45,9 @@ namespace Debugger
Empty.readOnly = true;
}
public bool Contains(Variable variable)
public bool Contains(Value variable)
{
foreach (Variable v in InnerList) {
foreach (Value v in InnerList) {
if (v == variable) {
return true;
}
@ -57,7 +57,7 @@ namespace Debugger @@ -57,7 +57,7 @@ namespace Debugger
public bool Contains(string variableName)
{
foreach (Variable v in InnerList) {
foreach (Value v in InnerList) {
if (v.Name == variableName) {
return true;
}
@ -65,25 +65,25 @@ namespace Debugger @@ -65,25 +65,25 @@ namespace Debugger
return false;
}
internal void Add(Variable variable)
internal void Add(Value variable)
{
if (readOnly) {
throw new DebuggerException("VariableCollection is marked as read only");
}
if (variable != null) {
InnerList.Add(variable);
OnVariableAdded(new VariableEventArgs(variable));
OnVariableAdded(new ValueEventArgs(variable));
}
}
internal void Remove(Variable variable)
internal void Remove(Value variable)
{
if (readOnly) {
throw new DebuggerException("VariableCollection is marked as read only");
}
if (variable != null) {
InnerList.Remove(variable);
OnVariableRemoved(new VariableEventArgs(variable));
OnVariableRemoved(new ValueEventArgs(variable));
}
}
@ -92,19 +92,19 @@ namespace Debugger @@ -92,19 +92,19 @@ namespace Debugger
/// </summary>
internal void Clear()
{
foreach(Variable variable in InnerList) {
foreach(Value variable in InnerList) {
Remove(variable);
}
Updating = null;
}
public Variable this[int index] {
public Value this[int index] {
get {
return (Variable) InnerList[index];
return (Value) InnerList[index];
}
}
public Variable this[string variableName] {
public Value this[string variableName] {
get {
int index = variableName.IndexOf('.');
if (index != -1) {
@ -112,7 +112,7 @@ namespace Debugger @@ -112,7 +112,7 @@ namespace Debugger
string subVariable = variableName.Substring(index + 1);
return this[rootVariable].SubVariables[subVariable];
} else {
foreach (Variable v in InnerList) {
foreach (Value v in InnerList) {
if (v.Name == variableName) {
return v;
}
@ -139,7 +139,7 @@ namespace Debugger @@ -139,7 +139,7 @@ namespace Debugger
mergedCollection.Update();
// Update existing variables
foreach(Variable variable in mergedCollection) {
foreach(Value variable in mergedCollection) {
if (this.Contains(variable.Name)) {
this.Remove(this[variable.Name]);
this.Add(variable);
@ -147,28 +147,28 @@ namespace Debugger @@ -147,28 +147,28 @@ namespace Debugger
}
// Add new variables
foreach(Variable variable in mergedCollection) {
foreach(Value variable in mergedCollection) {
if (!this.Contains(variable.Name)) {
this.Add(variable);
}
}
// Remove variables that are not in merged collection
foreach(Variable variable in this) {
foreach(Value variable in this) {
if (!mergedCollection.Contains(variable.Name)) {
this.Remove(variable);
}
}
}
protected virtual void OnVariableAdded(VariableEventArgs e)
protected virtual void OnVariableAdded(ValueEventArgs e)
{
if (VariableAdded != null) {
VariableAdded(this, e);
}
}
protected virtual void OnVariableRemoved(VariableEventArgs e)
protected virtual void OnVariableRemoved(ValueEventArgs e)
{
if (VariableRemoved != null) {
VariableRemoved(this, e);
@ -184,7 +184,7 @@ namespace Debugger @@ -184,7 +184,7 @@ namespace Debugger
public override string ToString() {
string txt = "";
foreach(Variable v in this) {
foreach(Value v in this) {
txt += v.ToString() + "\n";
}
@ -202,14 +202,14 @@ namespace Debugger @@ -202,14 +202,14 @@ namespace Debugger
{
// Add items of subcollections and ensure the stay in sync
foreach(VariableCollection collection in collections) {
foreach(Variable variable in collection) {
foreach(Value variable in collection) {
this.Add(variable);
}
collection.VariableAdded += delegate(object sender, VariableEventArgs e) {
this.Add(e.Variable);
collection.VariableAdded += delegate(object sender, ValueEventArgs e) {
this.Add(e.Value);
};
collection.VariableRemoved += delegate(object sender, VariableEventArgs e) {
this.Remove(e.Variable);
collection.VariableRemoved += delegate(object sender, ValueEventArgs e) {
this.Remove(e.Value);
};
}

Loading…
Cancel
Save