本文整理汇总了C#中ISymUnmanagedVariable类的典型用法代码示例。如果您正苦于以下问题:C# ISymUnmanagedVariable类的具体用法?C# ISymUnmanagedVariable怎么用?C# ISymUnmanagedVariable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISymUnmanagedVariable类属于命名空间,在下文中一共展示了ISymUnmanagedVariable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SymVariable
internal SymVariable(ISymUnmanagedVariable variable)
{
// We should not wrap null instances
if (variable == null)
throw new ArgumentNullException("variable");
m_unmanagedVariable = variable;
}
示例2: SymbolVariable
internal SymbolVariable(ISymUnmanagedVariable unmanagedVariable)
{
if (unmanagedVariable == null)
{
throw new ArgumentNullException("unmanagedVariable");
}
this.unmanagedVariable = unmanagedVariable;
}
示例3: GetGlobalVariables
public ISymbolVariable[] GetGlobalVariables() {
uint numVars;
reader.GetGlobalVariables(0, out numVars, null);
var unVars = new ISymUnmanagedVariable[numVars];
reader.GetGlobalVariables((uint)unVars.Length, out numVars, unVars);
var vars = new ISymbolVariable[numVars];
for (uint i = 0; i < numVars; i++)
vars[i] = new SymbolVariable(unVars[i]);
return vars;
}
示例4: GetParameters
public ISymbolVariable[] GetParameters() {
uint numVars;
method.GetParameters(0, out numVars, null);
var unVars = new ISymUnmanagedVariable[numVars];
method.GetParameters((uint)unVars.Length, out numVars, unVars);
var vars = new ISymbolVariable[numVars];
for (uint i = 0; i < numVars; i++)
vars[i] = new SymbolVariable(unVars[i]);
return vars;
}
示例5: GetVariables
public ISymbolVariable[] GetVariables()
{
int cVars = 0;
uint i;
m_unmanagedNamespace.GetVariables(0, out cVars, null);
var unmanagedVariables = new ISymUnmanagedVariable[cVars];
m_unmanagedNamespace.GetVariables(cVars, out cVars, unmanagedVariables);
var Variables = new ISymbolVariable[cVars];
for (i = 0; i < cVars; i++)
{
Variables[i] = new SymVariable(unmanagedVariables[i]);
}
return Variables;
}
示例6: GetLocals
internal override int GetLocals(int bufferLength, out int count, ISymUnmanagedVariable[] locals)
{
var mdReader = SymMethod.MetadataReader;
var scope = mdReader.GetLocalScope(_handle);
var handles = scope.GetLocalVariables();
int i = 0;
foreach (var handle in handles)
{
if (i >= bufferLength)
{
break;
}
locals[i++] = new SymVariable(SymMethod, handle);
}
count = (bufferLength == 0) ? handles.Count : i;
return HResult.S_OK;
}
示例7: SymbolVariable
public SymbolVariable(ISymUnmanagedVariable variable) {
this.variable = variable;
}
示例8: ProbeScopeForLocals
//
// Gather the local details in a scope and then recurse to child scopes
//
private void ProbeScopeForLocals(List<ILLocalVariable> variables, ISymUnmanagedScope scope)
{
int localCount;
ThrowExceptionForHR(scope.GetLocalCount(out localCount));
ISymUnmanagedVariable[] locals = new ISymUnmanagedVariable[localCount];
ThrowExceptionForHR(scope.GetLocals(localCount, out localCount, locals));
for (int i = 0; i < localCount; i++)
{
var local = locals[i];
int slot;
ThrowExceptionForHR(local.GetAddressField1(out slot));
int nameLength;
ThrowExceptionForHR(local.GetName(0, out nameLength, null));
// nameLength includes terminating '\0'
char[] nameBuffer = new char[nameLength];
ThrowExceptionForHR(local.GetName(nameLength, out nameLength, nameBuffer));
int attributes;
ThrowExceptionForHR(local.GetAttributes(out attributes));
variables.Add(new ILLocalVariable() { Slot = slot, Name = new String(nameBuffer, 0, nameLength - 1), CompilerGenerated = (attributes & 0x1) != 0 });
}
int childrenCount;
ThrowExceptionForHR(scope.GetChildren(0, out childrenCount, null));
ISymUnmanagedScope[] children = new ISymUnmanagedScope[childrenCount];
ThrowExceptionForHR(scope.GetChildren(childrenCount, out childrenCount, children));
for (int i = 0; i < childrenCount; i++)
{
ProbeScopeForLocals(variables, children[i]);
}
}
示例9: GetVariables
public ISymbolVariable[] GetVariables(SymbolToken parent)
{
int cVars = 0;
uint i;
m_reader.GetVariables(parent, 0, out cVars, null);
ISymUnmanagedVariable[] unmanagedVariables = new ISymUnmanagedVariable[cVars];
m_reader.GetVariables(parent, cVars, out cVars, unmanagedVariables);
SymVariable[] variables = new SymVariable[cVars];
for (i = 0; i < cVars; i++)
{
variables[i] = new SymVariable(unmanagedVariables[i]);
}
return variables;
}
示例10: GetParameters
public int GetParameters(int cParams, out int pcParams, ISymUnmanagedVariable[] parms)
{
throw new NotImplementedException();
}
示例11: GetVariables
public ISymbolVariable[] GetVariables(SymbolToken parent) {
uint numVars;
reader.GetVariables((uint)parent.GetToken(), 0, out numVars, null);
var unVars = new ISymUnmanagedVariable[numVars];
reader.GetVariables((uint)parent.GetToken(), (uint)unVars.Length, out numVars, unVars);
var vars = new ISymbolVariable[numVars];
for (uint i = 0; i < numVars; i++)
vars[i] = new SymbolVariable(unVars[i]);
return vars;
}
示例12: _PrintLocals
static void _PrintLocals(ICorDebugILFrame ilframe, ISymUnmanagedScope unmScope, uint ip, System.IO.TextWriter writer)
{
int varcount;
unmScope.GetLocalCount(out varcount);
ISymUnmanagedVariable[] vars = new ISymUnmanagedVariable[varcount];
unmScope.GetLocals(varcount, out varcount, vars);
for (int iv = 0; iv < varcount; iv++)
{
ISymUnmanagedVariable var = vars[iv];
string varname;
{
int namelen;
var.GetName(0, out namelen, null);
StringBuilder sbName = new StringBuilder(namelen);
var.GetName(sbName.Capacity, out namelen, sbName);
namelen--; // Remove nul.
sbName.Length = namelen;
varname = sbName.ToString();
}
string valstr;
{
int field1;
var.GetAddressField1(out field1);
ICorDebugValue pvalue;
ilframe.GetLocalVariable((uint)field1, out pvalue);
valstr = ToString(pvalue);
}
writer.WriteLine("{0}={1}", varname, valstr);
}
int cChildren;
unmScope.GetChildren(0, out cChildren, null);
ISymUnmanagedScope[] children = new ISymUnmanagedScope[cChildren];
unmScope.GetChildren(children.Length, out cChildren, children);
for (int ic = 0; ic < cChildren; ic++)
{
_PrintLocals(ilframe, children[ic], ip, writer);
}
}
示例13: GetLocals
public static ISymUnmanagedVariable[] GetLocals(this ISymUnmanagedScope symScope)
{
uint count;
symScope.GetLocals(0, out count, new ISymUnmanagedVariable[0]);
ISymUnmanagedVariable[] locals = new ISymUnmanagedVariable[count];
symScope.GetLocals(count, out count, locals);
return locals;
}
示例14: GetLocals
public ISymbolVariable[] GetLocals()
{
int count;
m_target.GetLocals(0, out count, null);
ISymUnmanagedVariable[] uVariables = new ISymUnmanagedVariable[count];
m_target.GetLocals(count, out count, uVariables);
int i;
ISymbolVariable[] variables = new ISymbolVariable[count];
for (i = 0; i < count; i++)
{
variables[i] = new SymVariable(uVariables[i]);
}
return variables;
}
示例15: GetLocals
internal override int GetLocals(int bufferLength, out int count, ISymUnmanagedVariable[] locals)
{
// C# and VB never define any locals in the root scope
count = 0;
return HResult.S_OK;
}