private void OpenMethod(uint methodToken) { try { _symWriter.OpenMethod(methodToken); _symWriter.OpenScope(0); } catch (Exception ex) { throw new PdbWritingException(ex); } }
private void OpenMethod(uint methodToken) { try { _symWriter.OpenMethod(methodToken); // open root scope: _symWriter.OpenScope(startOffset: 0); } catch (Exception ex) { throw new PdbWritingException(ex); } }
public int OpenScope(int startOffset) { int result; m_writer.OpenScope(startOffset, out result); return(result); }
public int OpenScope(int startOffset) { uint result; writer.OpenScope((uint)startOffset, out result); return((int)result); }
public int OpenScope(int startOffset) { int rslt; writer.OpenScope(startOffset, out rslt); return(rslt); }
internal void Do(ISymUnmanagedWriter2 symUnmanagedWriter) { symUnmanagedWriter.OpenScope(startOffset); foreach (KeyValuePair <string, LocalVar> kv in locals) { symUnmanagedWriter.DefineLocalVariable2(kv.Key, (int)kv.Value.attributes, kv.Value.signature, (int)kv.Value.addrKind, kv.Value.addr1, kv.Value.addr2, kv.Value.addr3, kv.Value.startOffset, kv.Value.endOffset); } foreach (Scope scope in scopes) { scope.Do(symUnmanagedWriter); } symUnmanagedWriter.CloseScope(endOffset); }
private void WriteScope(Scope scope, Function function) { pdb.OpenScope(scope.Offset); WriteVariables(scope.Variables, function.VariablesToken, scope.Offset, scope.Length); WriteConstants(scope.Constants); WriteScopes(scope.Scopes, function); // TODO // scope.usedNamespaces pdb.CloseScope(scope.Offset + scope.Length); }
/// <summary> /// Emits scope debugging symbols based on <c>ISymUnmanagedScope</c> insatnce, representing /// scope from new assembly. /// </summary> /// <param name="smScope">Scope from new version of changed assembly.</param> /// <param name="placeholder">Placeholder translation for local variables.</param> public void EmitScope(ISymUnmanagedScope smScope, Dictionary <int, int> placeholder) { if (State != WriterState.Building) { throw new TranslatingException("ISym* interfaces were not initialized."); } uint scStartOffset = smScope.__GetStartOffset(); uint scEndOffset = smScope.__GetEndOffset(); mWriter.OpenScope(scStartOffset); uint localsCount = smScope.__GetLocalCount(); if (localsCount > 0) { uint read; ISymUnmanagedVariable[] variables = new ISymUnmanagedVariable[localsCount]; smScope.__GetLocals(localsCount, out read, variables); for (int i = 0; i < localsCount; i++) { byte[] signature = variables[i].GetSignature(); Signature sig = new Signature(signature); sig.Migrate(translator); signature = sig.Compress(); string name = variables[i].GetName(); uint addr1 = 0; //variables[i].GetAddressField1(); uint addr2 = 0; //variables[i].GetAddressField2(); uint addr3 = 0; //variables[i].GetAddressField3(); uint addrKind = variables[i].GetAddressKind(); //variables[i].GetAddressKind(); if ((variables[i].GetAttributes() & 1) != 1) { addr1 = variables[i].GetAddressField1(); addrKind = variables[i].GetAddressKind(); if (placeholder != null && placeholder.ContainsKey((int)addr1)) { addr1 = (uint)placeholder[(int)addr1]; } } uint varStartOffset = scStartOffset; uint varEndOffset = scEndOffset; uint attributes = variables[i].GetAttributes(); IntPtr pName = Marshal.StringToCoTaskMemUni(name); IntPtr pSig = Marshal.AllocCoTaskMem(signature.Length); Marshal.Copy(signature, 0, pSig, signature.Length); try{ mWriter.DefineLocalVariable(pName, attributes, (uint)signature.Length, pSig, addrKind, addr1, addr2, addr3, varStartOffset, varEndOffset); } finally { Marshal.FreeCoTaskMem(pSig); Marshal.FreeCoTaskMem(pName); } } } ISymUnmanagedScope[] subScopes = smScope.GetChildren(); foreach (ISymUnmanagedScope subScope in subScopes) { EmitScope(subScope, placeholder); } mWriter.CloseScope(scEndOffset); }
public override int OpenScope(int startOffset) { writer.OpenScope((uint)startOffset, out uint result); return((int)result); }
internal void Do(ISymUnmanagedWriter2 symUnmanagedWriter) { symUnmanagedWriter.OpenScope(startOffset); foreach (KeyValuePair<string, LocalVar> kv in locals) { symUnmanagedWriter.DefineLocalVariable2(kv.Key, (int)kv.Value.attributes, kv.Value.signature, (int)kv.Value.addrKind, kv.Value.addr1, kv.Value.addr2, kv.Value.addr3, kv.Value.startOffset, kv.Value.endOffset); } foreach (Scope scope in scopes) { scope.Do(symUnmanagedWriter); } symUnmanagedWriter.CloseScope(endOffset); }