本文整理汇总了C#中ISymUnmanagedVariable.GetAddressField1方法的典型用法代码示例。如果您正苦于以下问题:C# ISymUnmanagedVariable.GetAddressField1方法的具体用法?C# ISymUnmanagedVariable.GetAddressField1怎么用?C# ISymUnmanagedVariable.GetAddressField1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISymUnmanagedVariable
的用法示例。
在下文中一共展示了ISymUnmanagedVariable.GetAddressField1方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLocalVariableValue
static Value GetLocalVariableValue(StackFrame context, ISymUnmanagedVariable symVar)
{
ICorDebugValue corVal;
try {
corVal = context.CorILFrame.GetLocalVariable((uint)symVar.GetAddressField1());
} catch (COMException e) {
if ((uint)e.ErrorCode == 0x80131304) throw new GetValueException("Unavailable in optimized code");
throw;
}
return new Value(context.AppDomain, corVal);
}
示例2: ValidateVariable
public static void ValidateVariable(ISymUnmanagedVariable variable, string name, int slot, LocalVariableAttributes attributes, byte[] signature)
{
int length, length2;
// name:
Assert.Equal(HResult.S_OK, variable.GetName(0, out length, null));
Assert.Equal(name.Length + 1, length);
var actualName = new char[length];
Assert.Equal(HResult.S_OK, variable.GetName(length, out length2, actualName));
Assert.Equal(length, length2);
Assert.Equal(name + "\0", new string(actualName));
int value;
Assert.Equal(HResult.S_OK, variable.GetAddressField1(out value));
Assert.Equal(slot, value);
Assert.Equal(HResult.E_NOTIMPL, variable.GetAddressField2(out value));
Assert.Equal(HResult.E_NOTIMPL, variable.GetAddressField3(out value));
Assert.Equal(HResult.E_NOTIMPL, variable.GetStartOffset(out value));
Assert.Equal(HResult.E_NOTIMPL, variable.GetEndOffset(out value));
Assert.Equal(HResult.S_OK, variable.GetAttributes(out value));
Assert.Equal(attributes, (LocalVariableAttributes)value);
Assert.Equal(HResult.S_OK, variable.GetAddressKind(out value));
Assert.Equal(1, value);
Assert.Equal(HResult.S_OK, variable.GetSignature(0, out length, null));
var actualSignature = new byte[length];
Assert.Equal(HResult.S_OK, variable.GetSignature(length, out length2, actualSignature));
Assert.Equal(length, length2);
AssertEx.Equal(signature, actualSignature);
}