Browse Source

Bugfix - Arguments of static functions

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@265 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
3415506f6d
  1. 12
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs

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

@ -366,7 +366,8 @@ namespace DebuggerLibrary
public string GetParameterName(int index) public string GetParameterName(int index)
{ {
return module.MetaData.GetParamForMethodIndex(methodProps.Token, (uint)index).Name; // index = 0 is return parameter
return module.MetaData.GetParamForMethodIndex(methodProps.Token, (uint)index + 1).Name;
} }
public int GetArgumentCount { public int GetArgumentCount {
@ -382,7 +383,8 @@ namespace DebuggerLibrary
internal ICorDebugValue GetArgumentValue(int index) internal ICorDebugValue GetArgumentValue(int index)
{ {
ICorDebugValue arg; ICorDebugValue arg;
corILFrame.GetArgument((uint)index, out arg); // Non-static functions include 'this' as first argument
corILFrame.GetArgument((uint)(IsStatic? index : (index + 1)), out arg);
return arg; return arg;
} }
@ -391,8 +393,12 @@ namespace DebuggerLibrary
VariableCollection arguments = new VariableCollection(); VariableCollection arguments = new VariableCollection();
int argCount = GetArgumentCount; int argCount = GetArgumentCount;
if (!IsStatic) {
argCount--; // Remove 'this' from count
}
for (int i = (IsStatic?0:1); i < argCount; i++) { for (int i = 0; i < argCount; i++) {
arguments.Add(VariableFactory.CreateVariable(debugger, GetArgumentValue(i), GetParameterName(i))); arguments.Add(VariableFactory.CreateVariable(debugger, GetArgumentValue(i), GetParameterName(i)));
} }

Loading…
Cancel
Save