private void WriteIteratorScopes(Function function) { if (function.IteratorScopes.Count == 0) { return; } var buffer = new ByteBuffer(); buffer.WriteByte(4); buffer.WriteByte(1); buffer.Align(4); buffer.WriteByte(4); buffer.WriteByte(3); buffer.Align(4); var scopes = function.IteratorScopes; buffer.WriteInt32(scopes.Count * 8 + 12); buffer.WriteInt32(scopes.Count); foreach (var scope in scopes) { buffer.WriteInt32(scope.Offset); buffer.WriteInt32(scope.Offset + scope.Length); } pdb.SetSymAttribute(function.Token, "MD2", buffer.length, buffer.buffer); }
public void DefineCustomMetadata(string name, byte [] metadata) { var handle = GCHandle.Alloc(metadata, GCHandleType.Pinned); m_writer.SetSymAttribute(0, name, (uint)metadata.Length, handle.AddrOfPinnedObject()); handle.Free(); }
private unsafe void DefineCustomMetadata(string name, byte[] metadata) { fixed(byte *pb = metadata) { try { // parent parameter is not used, it must be zero or the current method token passed to OpenMetod. _symWriter.SetSymAttribute(0, name, (uint)metadata.Length, (IntPtr)pb); } catch (Exception ex) { throw new PdbWritingException(ex); } } }
public void SetSymAttribute(SymbolToken parent, string name, byte[] data) { writer.SetSymAttribute((uint)parent.GetToken(), name, (uint)data.Length, data); }
public override void SetSymAttribute(MDToken parent, string name, byte[] data) => writer.SetSymAttribute(parent.Raw, name, (uint)data.Length, data);
public void SetSymAttribute(SymbolToken method, string name, int length, byte [] data) { m_writer.SetSymAttribute(method, name, (uint)length, data); }