Cosmos/source/Cosmos.Debug.Symbols/MethodBaseExtensions.cs
José Pedro 3db5ce43bb Compiler fixes.
Compiler fixes.
Updated project.json files.
Removed *.lock.json files and updated gitignore to ignore them.
Updated some Cosmos.Debug projects.
2017-01-08 14:54:29 +00:00

26 lines
963 B
C#

using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Metadata;
namespace Cosmos.Debug.Symbols
{
public static class MethodBaseExtensions
{
public static IList<LocalVariable> GetLocalVariables(this MethodBase aThis)
{
return DebugSymbolReader.GetReader(aThis.DeclaringType.GetTypeInfo().Assembly.Location).GetLocalVariables(aThis.MetadataToken);
}
public static string GetLocalVariableName(this MethodBase aThis, int aIndex)
{
return DebugSymbolReader.GetReader(aThis.DeclaringType.GetTypeInfo().Assembly.Location).GetLocalVariableName(aThis.MetadataToken, aIndex);
}
public static MethodBodyBlock GetMethodBody(this MethodBase aThis)
{
var xReader = DebugSymbolReader.GetReader(aThis.DeclaringType.GetTypeInfo().Assembly.Location);
return xReader.GetMethodBodyBlock(aThis.MetadataToken);
}
}
}