• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Pdb.BitAccess类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.Cci.Pdb.BitAccess的典型用法代码示例。如果您正苦于以下问题:C# BitAccess类的具体用法?C# BitAccess怎么用?C# BitAccess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BitAccess类属于Microsoft.Cci.Pdb命名空间,在下文中一共展示了BitAccess类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DbiModuleInfo

 internal DbiModuleInfo(BitAccess bits, bool readStrings) {
   bits.ReadInt32(out opened);
   section = new DbiSecCon(bits);
   bits.ReadUInt16(out flags);
   bits.ReadInt16(out stream);
   bits.ReadInt32(out cbSyms);
   bits.ReadInt32(out cbOldLines);
   bits.ReadInt32(out cbLines);
   bits.ReadInt16(out files);
   bits.ReadInt16(out pad1);
   bits.ReadUInt32(out offsets);
   bits.ReadInt32(out niSource);
   bits.ReadInt32(out niCompiler);
   if (readStrings) {
     bits.ReadCString(out moduleName);
     bits.ReadCString(out objectName);
   } else {
     bits.SkipCString(out moduleName);
     bits.SkipCString(out objectName);
   }
   bits.Align(4);
   //if (opened != 0 || pad1 != 0) {
   //  throw new PdbException("Invalid DBI module. "+
   //                                 "(opened={0}, pad={1})", opened, pad1);
   //}
 }
开发者ID:halukmy,项目名称:CryMono,代码行数:26,代码来源:DbiModuleInfo.cs


示例2: LoadNameIndex

    static Dictionary<string, int> LoadNameIndex(BitAccess bits) {
      Dictionary<string, int> result = new Dictionary<string, int>();
      int ver;
      int sig;
      int age;
      Guid guid;
      bits.ReadInt32(out ver);    //  0..3  Version
      bits.ReadInt32(out sig);    //  4..7  Signature
      bits.ReadInt32(out age);    //  8..11 Age
      bits.ReadGuid(out guid);       // 12..27 GUID

      //if (ver != 20000404) {
      //  throw new PdbDebugException("Unsupported PDB Stream version {0}", ver);
      //}

      // Read string buffer.
      int buf;
      bits.ReadInt32(out buf);    // 28..31 Bytes of Strings

      int beg = bits.Position;
      int nxt = bits.Position + buf;

      bits.Position = nxt;

      // Read map index.
      int cnt;        // n+0..3 hash size.
      int max;        // n+4..7 maximum ni.

      bits.ReadInt32(out cnt);
      bits.ReadInt32(out max);

      BitSet present = new BitSet(bits);
      BitSet deleted = new BitSet(bits);
      if (!deleted.IsEmpty) {
        throw new PdbDebugException("Unsupported PDB deleted bitset is not empty.");
      }

      int j = 0;
      for (int i = 0; i < max; i++) {
        if (present.IsSet(i)) {
          int ns;
          int ni;
          bits.ReadInt32(out ns);
          bits.ReadInt32(out ni);

          string name;
          int saved = bits.Position;
          bits.Position = beg + ns;
          bits.ReadCString(out name);
          bits.Position = saved;

          result.Add(name.ToUpperInvariant(), ni);
          j++;
        }
      }
      if (j != cnt) {
        throw new PdbDebugException("Count mismatch. ({0} != {1})", j, cnt);
      }
      return result;
    }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:60,代码来源:PdbFile.cs


示例3: DataStream

 internal DataStream(int contentSize, BitAccess bits, int count) {
   this.contentSize = contentSize;
   if (count > 0) {
     this.pages = new int[count];
     bits.ReadInt32(this.pages);
   }
 }
开发者ID:pusp,项目名称:o2platform,代码行数:7,代码来源:DataStream.cs


示例4: MsfDirectory

    internal MsfDirectory(PdbReader reader, PdbFileHeader head, BitAccess bits) {
      bits.MinCapacity(head.directorySize);
      int pages = reader.PagesFromSize(head.directorySize);

      // 0..n in page of directory pages.
      reader.Seek(head.directoryRoot, 0);
      bits.FillBuffer(reader.reader, pages * 4);

      DataStream stream = new DataStream(head.directorySize, bits, pages);
      bits.MinCapacity(head.directorySize);
      stream.Read(reader, bits);

      // 0..3 in directory pages
      int count;
      bits.ReadInt32(out count);

      // 4..n
      int[] sizes = new int[count];
      bits.ReadInt32(sizes);

      // n..m
      streams = new DataStream[count];
      for (int i = 0; i < count; i++) {
        if (sizes[i] <= 0) {
          streams[i] = new DataStream();
        } else {
          streams[i] = new DataStream(sizes[i], bits,
                                      reader.PagesFromSize(sizes[i]));
        }
      }
    }
开发者ID:pusp,项目名称:o2platform,代码行数:31,代码来源:MsfDirectory.cs


示例5: LoadFunctions

        internal static PdbFunction[] LoadFunctions(Stream read, out Dictionary<uint, PdbTokenLine> tokenToSourceMapping)
        {
            tokenToSourceMapping = new Dictionary<uint, PdbTokenLine>();
              BitAccess bits = new BitAccess(512 * 1024);
              PdbFileHeader head = new PdbFileHeader(read, bits);
              PdbReader reader = new PdbReader(read, head.pageSize);
              MsfDirectory dir = new MsfDirectory(reader, head, bits);
              DbiModuleInfo[] modules = null;
              DbiDbgHdr header;

              dir.streams[1].Read(reader, bits);
              Dictionary<string, int> nameIndex = LoadNameIndex(bits);
              int nameStream;
              if (!nameIndex.TryGetValue("/NAMES", out nameStream)) {
            throw new PdbException("No `name' stream");
              }

              dir.streams[nameStream].Read(reader, bits);
              IntHashTable names = LoadNameStream(bits);

              dir.streams[3].Read(reader, bits);
              LoadDbiStream(bits, out modules, out header, true);

              ArrayList funcList = new ArrayList();

              if (modules != null) {
            for (int m = 0; m < modules.Length; m++) {
              var module = modules[m];
              if (module.stream > 0) {
            dir.streams[module.stream].Read(reader, bits);
            if (module.moduleName == "TokenSourceLineInfo") {
              LoadTokenToSourceInfo(bits, module, names, dir, nameIndex, reader, tokenToSourceMapping);
              continue;
            }
            LoadFuncsFromDbiModule(bits, module, names, funcList, true, dir, nameIndex, reader);
              }
            }
              }

              PdbFunction[] funcs = (PdbFunction[])funcList.ToArray(typeof(PdbFunction));

              // After reading the functions, apply the token remapping table if it exists.
              if (header.snTokenRidMap != 0 && header.snTokenRidMap != 0xffff) {
            dir.streams[header.snTokenRidMap].Read(reader, bits);
            uint[] ridMap = new uint[dir.streams[header.snTokenRidMap].Length / 4];
            bits.ReadUInt32(ridMap);

            foreach (PdbFunction func in funcs) {
              func.token = 0x06000000 | ridMap[func.token & 0xffffff];
            }
              }

              //
              Array.Sort(funcs, PdbFunction.byAddressAndToken);
              //Array.Sort(funcs, PdbFunction.byToken);
              return funcs;
        }
开发者ID:rasiths,项目名称:visual-profiler,代码行数:57,代码来源:PdbFile.cs


示例6: Write

    internal void Write(Stream writer, BitAccess bits) {
      bits.MinCapacity(56);
      bits.WriteBytes(magic);                     //   0..31
      bits.WriteInt32(pageSize);                  //  32..35
      bits.WriteInt32(freePageMap);               //  36..39
      bits.WriteInt32(pagesUsed);                 //  40..43
      bits.WriteInt32(directorySize);             //  44..47
      bits.WriteInt32(zero);                      //  48..51
      bits.WriteInt32(directoryRoot);             //  52..55

      writer.Seek(0, SeekOrigin.Begin);
      bits.WriteBuffer(writer, 56);
    }
开发者ID:pusp,项目名称:o2platform,代码行数:13,代码来源:PdbFileHeader.cs


示例7: DbiDbgHdr

 internal DbiDbgHdr(BitAccess bits) {
   bits.ReadUInt16(out snFPO);
   bits.ReadUInt16(out snException);
   bits.ReadUInt16(out snFixup);
   bits.ReadUInt16(out snOmapToSrc);
   bits.ReadUInt16(out snOmapFromSrc);
   bits.ReadUInt16(out snSectionHdr);
   bits.ReadUInt16(out snTokenRidMap);
   bits.ReadUInt16(out snXdata);
   bits.ReadUInt16(out snPdata);
   bits.ReadUInt16(out snNewFPO);
   bits.ReadUInt16(out snSectionHdrOrig);
 }
开发者ID:pusp,项目名称:o2platform,代码行数:13,代码来源:DbiDbgHdr.cs


示例8: LoadFunctions

        internal static PdbFunction[] LoadFunctions(Stream read, BitAccess bits, bool readAllStrings)
        {
            PdbFileHeader head = new PdbFileHeader(read, bits);
              PdbReader reader = new PdbReader(read, head.PageSize);
              MsfDirectory dir = new MsfDirectory(reader, head, bits);
              DbiModuleInfo[] modules;
              DbiDbgHdr header;

              dir.streams[1].Read(reader, bits);
              Dictionary<string, int> nameIndex = LoadNameIndex(bits);
              int nameStream;
              if (!nameIndex.TryGetValue("/names", out nameStream)) {
            throw new PdbException("No `name' stream");
              }

              dir.streams[nameStream].Read(reader, bits);
              IntHashTable names = LoadNameStream(bits);

              dir.streams[3].Read(reader, bits);
              LoadDbiStream(bits, out modules, out header, readAllStrings);

              ArrayList funcList = new ArrayList();

              if (modules != null) {
            for (int m = 0; m < modules.Length; m++) {
              if (modules[m].stream > 0) {
            dir.streams[modules[m].stream].Read(reader, bits);
            LoadFuncsFromDbiModule(bits, modules[m], names, funcList,
                                   readAllStrings, dir, nameIndex, reader);
              }
            }
              }

              PdbFunction[] funcs = (PdbFunction[])funcList.ToArray(typeof(PdbFunction));

              // After reading the functions, apply the token remapping table if it exists.
              if (header.snTokenRidMap != 0 && header.snTokenRidMap != 0xffff) {
            dir.streams[header.snTokenRidMap].Read(reader, bits);
            uint[] ridMap = new uint[dir.streams[header.snTokenRidMap].Length / 4];
            bits.ReadUInt32(ridMap);

            foreach (PdbFunction func in funcs) {
              func.Token = 0x06000000 | ridMap[func.Token & 0xffffff];
            }
              }

              //
              Array.Sort(funcs, PdbFunction.ByAddress);
              //Array.Sort(funcs, PdbFunction.byToken);
              return funcs;
        }
开发者ID:RoqueDeicide,项目名称:CryCIL,代码行数:51,代码来源:PdbFile.cs


示例9: PdbFileHeader

    internal PdbFileHeader(Stream reader, BitAccess bits) {
      bits.MinCapacity(56);
      reader.Seek(0, SeekOrigin.Begin);
      bits.FillBuffer(reader, 56);

      this.magic = new byte[32];
      bits.ReadBytes(this.magic);                 //   0..31
      bits.ReadInt32(out this.pageSize);          //  32..35
      bits.ReadInt32(out this.freePageMap);       //  36..39
      bits.ReadInt32(out this.pagesUsed);         //  40..43
      bits.ReadInt32(out this.directorySize);     //  44..47
      bits.ReadInt32(out this.zero);              //  48..51
      bits.ReadInt32(out this.directoryRoot);     //  52..55
    }
开发者ID:pusp,项目名称:o2platform,代码行数:14,代码来源:PdbFileHeader.cs


示例10: WriteMeta

    internal void WriteMeta(DataStream[] streams, BitAccess bits) {
      PdbFileHeader head = new PdbFileHeader(pageSize);

      WriteDirectory(streams,
                     out head.directoryRoot,
                     out head.directorySize,
                     bits);
      WriteFreeMap();

      head.freePageMap = 2;
      head.pagesUsed = usedBytes / pageSize;

      writer.Seek(0, SeekOrigin.Begin);
      head.Write(writer, bits);
    }
开发者ID:pusp,项目名称:o2platform,代码行数:15,代码来源:PdbWriter.cs


示例11: DbiSecCon

 internal DbiSecCon(BitAccess bits) {
   bits.ReadInt16(out section);
   bits.ReadInt16(out pad1);
   bits.ReadInt32(out offset);
   bits.ReadInt32(out size);
   bits.ReadUInt32(out flags);
   bits.ReadInt16(out module);
   bits.ReadInt16(out pad2);
   bits.ReadUInt32(out dataCrc);
   bits.ReadUInt32(out relocCrc);
   //if (pad1 != 0 || pad2 != 0) {
   //  throw new PdbException("Invalid DBI section. "+
   //                                 "(pad1={0}, pad2={1})",
   //                         pad1, pad2);
   //}
 }
开发者ID:Refresh06,项目名称:visualmutator,代码行数:16,代码来源:DbiSecCon.cs


示例12: LoadInjectedSourceInformation

    static void LoadInjectedSourceInformation(BitAccess bits, out Guid doctype, out Guid language, out Guid vendor, out Guid checksumAlgo, out byte[] checksum) {
      int checksumSize;
      int injectedSourceSize;
      checksum = null;

      bits.ReadGuid(out language);
      bits.ReadGuid(out vendor);
      bits.ReadGuid(out doctype);
      bits.ReadGuid(out checksumAlgo);
      bits.ReadInt32(out checksumSize);
      bits.ReadInt32(out injectedSourceSize);

      if (checksumSize > 0) {
          checksum = new byte[checksumSize];
          bits.ReadBytes(checksum);
      }
    }
开发者ID:xornand,项目名称:cci,代码行数:17,代码来源:PdbFile.cs


示例13: LoadNameStream

    static IntHashTable LoadNameStream(BitAccess bits) {
      IntHashTable ht = new IntHashTable();

      uint sig;
      int ver;
      bits.ReadUInt32(out sig);   //  0..3  Signature
      bits.ReadInt32(out ver);    //  4..7  Version

      // Read (or skip) string buffer.
      int buf;
      bits.ReadInt32(out buf);    //  8..11 Bytes of Strings

      if (sig != 0xeffeeffe || ver != 1) {
        throw new PdbDebugException("Unsupported Name Stream version. "+
                                            "(sig={0:x8}, ver={1})",
                                    sig, ver);
      }
      int beg = bits.Position;
      int nxt = bits.Position + buf;
      bits.Position = nxt;

      // Read hash table.
      int siz;
      bits.ReadInt32(out siz);    // n+0..3 Number of hash buckets.
      nxt = bits.Position;

      for (int i = 0; i < siz; i++) {
        int ni;
        string name;

        bits.ReadInt32(out ni);

        if (ni != 0) {
          int saved = bits.Position;
          bits.Position = beg + ni;
          bits.ReadCString(out name);
          bits.Position = saved;

          ht.Add(ni, name);
        }
      }
      bits.Position = nxt;

      return ht;
    }
开发者ID:pusp,项目名称:o2platform,代码行数:45,代码来源:PdbFile.cs


示例14: MsfDirectory

    internal MsfDirectory(PdbReader reader, PdbFileHeader head, BitAccess bits)
    {
      int pages = reader.PagesFromSize(head.directorySize);

      // 0..n in page of directory pages.
      bits.MinCapacity(head.directorySize);
      int directoryRootPages = head.directoryRoot.Length;
      int pagesPerPage = head.pageSize / 4;
      int pagesToGo = pages;
      for (int i = 0; i < directoryRootPages; i++)
      {
        int pagesInThisPage = pagesToGo <= pagesPerPage ? pagesToGo : pagesPerPage;
        reader.Seek(head.directoryRoot[i], 0);
        bits.Append(reader.reader, pagesInThisPage * 4);
        pagesToGo -= pagesInThisPage;
      }
      bits.Position = 0;

      DataStream stream = new DataStream(head.directorySize, bits, pages);
      bits.MinCapacity(head.directorySize);
      stream.Read(reader, bits);

      // 0..3 in directory pages
      int count;
      bits.ReadInt32(out count);

      // 4..n
      int[] sizes = new int[count];
      bits.ReadInt32(sizes);

      // n..m
      streams = new DataStream[count];
      for (int i = 0; i < count; i++)
      {
        if (sizes[i] <= 0)
        {
          streams[i] = new DataStream();
        }
        else
        {
          streams[i] = new DataStream(sizes[i], bits,
                                      reader.PagesFromSize(sizes[i]));
        }
      }
    }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:45,代码来源:MsfDirectory.cs


示例15: PdbSlot

    //internal uint segment;
    //internal uint address;

    internal PdbSlot(BitAccess bits) {
      AttrSlotSym slot;

      bits.ReadUInt32(out slot.index);
      bits.ReadUInt32(out slot.typind);
      bits.ReadUInt32(out slot.offCod);
      bits.ReadUInt16(out slot.segCod);
      bits.ReadUInt16(out slot.flags);
      bits.ReadCString(out slot.name);

      this.slot = slot.index;
      this.typeToken = slot.typind;
      this.name = slot.name;
      this.flags = slot.flags;
      //this.segment = slot.segCod;
      //this.address = slot.offCod;

    }
开发者ID:Refresh06,项目名称:visualmutator,代码行数:21,代码来源:PdbSlot.cs


示例16: PdbSlot

        internal PdbSlot(BitAccess bits, out uint typind)
        {
            AttrSlotSym slot;

            bits.ReadUInt32(out slot.index);
            bits.ReadUInt32(out slot.typind);
            bits.ReadUInt32(out slot.offCod);
            bits.ReadUInt16(out slot.segCod);
            bits.ReadUInt16(out slot.flags);
            bits.ReadCString(out slot.name);

            this.Slot = slot.index;
            this.Name = slot.name;
            this.Flags = slot.flags;
            this.Segment = slot.segCod;
            this.Address = slot.offCod;

            typind = slot.typind;
        }
开发者ID:RoqueDeicide,项目名称:CryCIL,代码行数:19,代码来源:PdbSlot.cs


示例17: PdbFileHeader

        internal PdbFileHeader(Stream reader, BitAccess bits)
        {
            bits.MinCapacity(56);
              reader.Seek(0, SeekOrigin.Begin);
              bits.FillBuffer(reader, 52);

              this.magic = new byte[32];
              bits.ReadBytes(this.magic);                 //   0..31
              bits.ReadInt32(out this.pageSize);          //  32..35
              bits.ReadInt32(out this.freePageMap);       //  36..39
              bits.ReadInt32(out this.pagesUsed);         //  40..43
              bits.ReadInt32(out this.directorySize);     //  44..47
              bits.ReadInt32(out this.zero);              //  48..51

              if (Magic != MAGIC) {
            throw new InvalidOperationException("Magic is wrong.");
              }
              int directoryPages = ((((directorySize + pageSize - 1) / pageSize) * 4) + pageSize - 1) / pageSize;
              this.directoryRoot = new int[directoryPages];
              bits.FillBuffer(reader, directoryPages * 4);
              bits.ReadInt32(this.directoryRoot);
        }
开发者ID:jbevain,项目名称:cecil,代码行数:22,代码来源:PdbFileHeader.cs


示例18: DbiHeader

 internal DbiHeader(BitAccess bits) {
   bits.ReadInt32(out sig);
   bits.ReadInt32(out ver);
   bits.ReadInt32(out age);
   bits.ReadInt16(out gssymStream);
   bits.ReadUInt16(out vers);
   bits.ReadInt16(out pssymStream);
   bits.ReadUInt16(out pdbver);
   bits.ReadInt16(out symrecStream);
   bits.ReadUInt16(out pdbver2);
   bits.ReadInt32(out gpmodiSize);
   bits.ReadInt32(out secconSize);
   bits.ReadInt32(out secmapSize);
   bits.ReadInt32(out filinfSize);
   bits.ReadInt32(out tsmapSize);
   bits.ReadInt32(out mfcIndex);
   bits.ReadInt32(out dbghdrSize);
   bits.ReadInt32(out ecinfoSize);
   bits.ReadUInt16(out flags);
   bits.ReadUInt16(out machine);
   bits.ReadInt32(out reserved);
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:22,代码来源:DbiHeader.cs


示例19: WriteDirectory

    private void WriteDirectory(DataStream[] streams,
                                out int directoryRoot,
                                out int directorySize,
                                BitAccess bits) {
      DataStream directory = new DataStream();

      int pages = 0;
      for (int s = 0; s < streams.Length; s++) {
        if (streams[s].Length > 0) {
          pages += streams[s].Pages;
        }
      }

      int use = 4 * (1 + streams.Length + pages);
      bits.MinCapacity(use);
      bits.WriteInt32(streams.Length);
      for (int s = 0; s < streams.Length; s++) {
        bits.WriteInt32(streams[s].Length);
      }
      for (int s = 0; s < streams.Length; s++) {
        if (streams[s].Length > 0) {
          bits.WriteInt32(streams[s].pages);
        }
      }
      directory.Write(this, bits.Buffer, use);
      directorySize = directory.Length;

      use = 4 * directory.Pages;
      bits.MinCapacity(use);
      bits.WriteInt32(directory.pages);

      DataStream ddir = new DataStream();
      ddir.Write(this, bits.Buffer, use);

      directoryRoot = ddir.pages[0];
    }
开发者ID:pusp,项目名称:o2platform,代码行数:36,代码来源:PdbWriter.cs


示例20: PdbSynchronizationInformation

 internal PdbSynchronizationInformation(BitAccess bits) {
   uint asyncStepInfoCount;
   bits.ReadUInt32(out this.kickoffMethodToken);
   bits.ReadUInt32(out this.generatedCatchHandlerIlOffset);
   bits.ReadUInt32(out asyncStepInfoCount);
   this.synchronizationPoints = new PdbSynchronizationPoint[asyncStepInfoCount];
   for (uint i = 0; i < asyncStepInfoCount; i += 1) {
     this.synchronizationPoints[i] = new PdbSynchronizationPoint(bits);
   }
 }
开发者ID:453483289,项目名称:cecil,代码行数:10,代码来源:PdbFunction.cs



注:本文中的Microsoft.Cci.Pdb.BitAccess类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UtilityDataStructures.MemoryReader类代码示例发布时间:2022-05-26
下一篇:
C# Cci.SourceLocationBuilder类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap