GetToken() public method

public GetToken ( ) : int
return int
示例#1
0
        public virtual ISymbolMethod GetMethod(SymbolToken method, int version)
        {
            ISymbolMethod meth;

            if (methodCache == null)
            {
                methodCache = new Hashtable();
            }
            else if ((meth = (ISymbolMethod)methodCache
                             [method.GetToken()]) != null)
            {
                return(meth);
            }
            meth = new SymMethod(this, method.GetToken());
            methodCache[method.GetToken()] = meth;
            return(meth);
        }
示例#2
0
		public ISymbolMethod GetMethod(SymbolToken method, int version) {
			ISymUnmanagedMethod unMethod;
			int hr = reader.GetMethodByVersion((uint)method.GetToken(), version, out unMethod);
			if (hr == E_FAIL)
				return null;
			Marshal.ThrowExceptionForHR(hr);
			return unMethod == null ? null : new SymbolMethod(unMethod);
		}
        public RuntimeValue CallMemberFunction(RuntimeThread thread, SymbolToken token, params RuntimeValue[] arguments)
        {
            ICorDebugFunction comFunction;
            ComObjectValue.GetVirtualMethod((uint)token.GetToken(), out comFunction);

            var evaluation = thread.CreateEvaluation();
            evaluation.Call(comFunction, arguments.GetComValues().ToArray());

            if (evaluation.WaitForResult(1000))
                return evaluation.Result;

            throw new TimeoutException("Evaluation timed out.");
        }
示例#4
0
		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;
		}
示例#5
0
		public bool Equals (SymbolToken obj)
		{
			return(obj.GetToken () == _val);
		}
示例#6
0
		public void DefineField(SymbolToken parent, string name, System.Reflection.FieldAttributes attributes, byte[] signature, SymAddressKind addrKind, int addr1, int addr2, int addr3) {
			writer.DefineField((uint)parent.GetToken(), name, (uint)attributes, (uint)signature.Length, signature, (uint)addrKind, (uint)addr1, (uint)addr2, (uint)addr3);
		}
示例#7
0
		public void SetSymAttribute(SymbolToken parent, string name, byte[] data) {
			writer.SetSymAttribute((uint)parent.GetToken(), name, (uint)data.Length, data);
		}
 [System.Security.SecurityCritical] // auto-generated
 #endif
 void ISymbolWriter.SetSymAttribute(SymbolToken parent, String name, byte[] data)
 {
     int hr = m_vtable.SetSymAttribute(m_pWriter, parent.GetToken(), name, data.Length, data);
     if (hr < 0)
     {
         throw Marshal.GetExceptionForHR(hr);
     }
 }
 [System.Security.SecurityCritical] // auto-generated
 #endif
 void ISymbolWriter.SetUserEntryPoint(SymbolToken entryMethod)
 {
     int hr = m_vtable.SetUserEntryPoint(m_pWriter, entryMethod.GetToken());
     if (hr < 0)
     {
         throw Marshal.GetExceptionForHR(hr);
     }
 }
 public static RuntimeValue InvokeMethod(RuntimeThread thread, SymbolToken functionToken, params RuntimeValue[] arguments)
 {
     return InvokeMethod(thread, functionToken.GetToken(), arguments);
 }
示例#11
0
 private bool hasNoApplicationEntryPoint(SymbolToken token)
 {
     return token.GetToken() == 0;
 }
示例#12
0
	public virtual ISymbolMethod GetMethod(SymbolToken method, int version)
			{
				ISymbolMethod meth;
				if(methodCache == null)
				{
					methodCache = new Hashtable();
				}
				else if((meth = (ISymbolMethod)methodCache
							[method.GetToken()]) != null)
				{
					return meth;
				}
				meth = new SymMethod(this, method.GetToken());
				methodCache[method.GetToken()] = meth;
				return meth;
			}
示例#13
0
		ISymbolMethod ISymbolReader.GetMethod(SymbolToken method) {
			DbiFunction symMethod;
			if (functions.TryGetValue((uint)method.GetToken(), out symMethod))
				return symMethod;
			return null;
		}
示例#14
0
		public void OpenMethod(SymbolToken method, MethodBase mb)
		{
			int token = method.GetToken();
			currentMethod = new Method(token);
			methodMap.Add(token, mb);
		}
示例#15
0
 public void SetSymAttribute(SymbolToken parent, string name, byte[] data)
 {
     int hr;
     COMException Exception;
     hr = SymWriter_SetSymAttribute(m_Writer, parent.GetToken(), name, data);
     if (hr < 0)
     {
         Exception = new COMException("Call to SetSymAttribute failed.", hr);
         throw Exception;
     }
 }
示例#16
0
 public ISymbolMethod GetMethod(SymbolToken method, int version)
 {
     COMException Exception;
     int hr;
     IntPtr MethodPointer;
     hr = SymReader_GetMethodByVersion(m_Reader, method.GetToken(), version, out MethodPointer);
     if (hr < 0)
     {
         Exception = new COMException("Call to GetMethodByVersion failed.", hr);
         throw Exception;
     }        
     return new SymMethod(MethodPointer);
 }
示例#17
0
 public void OpenMethod(SymbolToken method)
 {
     currentMethod = new Method(method.GetToken());
 }
 [System.Security.SecurityCritical] // auto-generated
 #endif
 void ISymbolWriter.OpenMethod(SymbolToken method)
 {
     int hr = m_vtable.OpenMethod(m_pWriter, method.GetToken());
     if (hr < 0)
     {
         throw Marshal.GetExceptionForHR(hr);
     }
 }
示例#19
0
 public bool Equals(SymbolToken obj)
 {
     return(obj.GetToken() == _val);
 }
示例#20
0
		public void OpenMethod(SymbolToken method) {
			writer.OpenMethod((uint)method.GetToken());
		}
示例#21
0
        public ISymbolVariable[] GetVariables(SymbolToken parent) 
        {
            COMException Exception;
            int hr;
            IntPtr[] VariablePointers;
            SymVariable[] Variables;
            int cVars;
            uint i;
            hr = SymReader_GetVariables(m_Reader, parent.GetToken(), 0, out cVars, null);
            if (hr < 0)
            {
                Exception = new COMException("Call to GetVariables failed.", hr);
                throw Exception;
            }
            Variables = new SymVariable[cVars];
            VariablePointers = new IntPtr[cVars];

            hr = SymReader_GetVariables(m_Reader, parent.GetToken(), cVars, out cVars, VariablePointers);
            if (hr < 0)
            {
                Exception = new COMException("Call to GetVariables failed.", hr);
                throw Exception;
            }        
            for (i = 0; i < cVars; i++)
            {
                Variables[i] = new SymVariable(VariablePointers[i]);
            }
            return Variables;
        }
示例#22
0
		public void SetUserEntryPoint(SymbolToken entryMethod) {
			writer.SetUserEntryPoint((uint)entryMethod.GetToken());
		}
示例#23
0
 public byte[] GetSymAttribute(SymbolToken parent, string name) 
 {
     COMException Exception;
     int hr;
     int cBuffer;
     byte[] Buffer;
     hr = SymReader_GetSymAttribute(m_Reader, parent.GetToken(), name, 0, out cBuffer, null);
     if (hr < 0)
     {
         Exception = new COMException("Call to GetSymAttribute failed.", hr);
         throw Exception;
     }
     Buffer = new byte[cBuffer];
     hr = SymReader_GetSymAttribute(m_Reader, parent.GetToken(), name, cBuffer, out cBuffer, Buffer);
     if (hr < 0)
     {
         Exception = new COMException("Call to GetSymAttribute failed.", hr);
         throw Exception;
     }
     return Buffer;
 }
示例#24
0
		public void OpenMethod (SymbolToken method)
		{
			currentToken = method.GetToken ();
		}
示例#25
0
 public void SetUserEntryPoint(SymbolToken entryMethod)
 {
     int hr;
     COMException Exception;
     hr = SymWriter_SetUserEntryPoint(m_Writer, entryMethod.GetToken());
     if (hr < 0)
     {
         Exception = new COMException("Call to SetUserEntryPoint failed.", hr);
         throw Exception;
     }
 }
示例#26
0
		public byte[] GetSymAttribute(SymbolToken parent, string name) {
			uint bufSize;
			reader.GetSymAttribute((uint)parent.GetToken(), name, 0, out bufSize, null);
			var buffer = new byte[bufSize];
			reader.GetSymAttribute((uint)parent.GetToken(), name, (uint)buffer.Length, out bufSize, buffer);
			return buffer;
		}
示例#27
0
 public void OpenMethod(SymbolToken method)
 {
     int hr;
     COMException Exception;
     hr = SymWriter_OpenMethod(m_Writer, method.GetToken());
     if (hr < 0)
     {
         Exception = new COMException("Call to OpenMethod failed.", hr);
         throw Exception;
     }
 }
示例#28
0
 public void DefineField(
     SymbolToken parent,
     string name,
     FieldAttributes attributes,
     byte[] signature ,
     SymAddressKind addrKind,
     int addr1,
     int addr2,
     int addr3)
 {
     int hr;
     COMException Exception;
     hr = SymWriter_DefineField(
         m_Writer, parent.GetToken(), name,
         attributes.GetHashCode(), signature , (int)addrKind,
         addr1, addr2, addr3);
     if (hr < 0)
     {
         Exception = new COMException("Call to DefineField failed.", hr);
         throw Exception;
     }
 }
        public RuntimeValue GetFieldValue(RuntimeThread thread, SymbolToken token)
        {
            // TODO: static members

            if (!IsObject)
                throw new InvalidOperationException("Value must be an object in order to get values of fields.");

            RuntimeValue value;
            if (!_fieldValues.TryGetValue(token, out value))
            {
                ICorDebugValue comValue;
                ComObjectValue.GetFieldValue(Type.Class.ComClass, (uint)token.GetToken(), out comValue);
                _fieldValues.Add(token, value = new RuntimeValue(Session, comValue));
            }
            return value;
        }