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 @@ -366,7 +366,8 @@ namespace DebuggerLibrary
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 {
@ -382,7 +383,8 @@ namespace DebuggerLibrary @@ -382,7 +383,8 @@ namespace DebuggerLibrary
internal ICorDebugValue GetArgumentValue(int index)
{
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;
}
@ -392,7 +394,11 @@ namespace DebuggerLibrary @@ -392,7 +394,11 @@ namespace DebuggerLibrary
int argCount = GetArgumentCount;
for (int i = (IsStatic?0:1); i < argCount; i++) {
if (!IsStatic) {
argCount--; // Remove 'this' from count
}
for (int i = 0; i < argCount; i++) {
arguments.Add(VariableFactory.CreateVariable(debugger, GetArgumentValue(i), GetParameterName(i)));
}

Loading…
Cancel
Save