示例#1
0
 WindowsPdbWriter(PdbState pdbState, MetaData metaData)
 {
     this.pdbState      = pdbState;
     this.metaData      = metaData;
     this.module        = metaData.Module;
     this.instrToOffset = new Dictionary <Instruction, uint>();
     this.customDebugInfoWriterContext = new PdbCustomDebugInfoWriterContext();
     this.localsEndScopeIncValue       = pdbState.Compiler == Compiler.VisualBasic ? 1 : 0;
 }
示例#2
0
 WindowsPdbWriter(PdbState pdbState, Metadata metadata)
 {
     this.pdbState = pdbState;
     this.metadata = metadata;
     module        = metadata.Module;
     instrToOffset = new Dictionary <Instruction, uint>();
     customDebugInfoWriterContext = new PdbCustomDebugInfoWriterContext();
     localsEndScopeIncValue       = PdbUtils.IsEndInclusive(PdbFileKind.WindowsPDB, pdbState.Compiler) ? 1 : 0;
 }
示例#3
0
 PdbCustomDebugInfoWriter(MetaData metaData, MethodDef method, PdbCustomDebugInfoWriterContext context)
 {
     this.metaData                     = metaData;
     this.method                       = method;
     this.logger                       = context.Logger;
     this.memoryStream                 = context.MemoryStream;
     this.writer                       = context.Writer;
     this.instructionToOffsetDict      = context.InstructionToOffsetDict;
     this.bodySize                     = 0;
     this.instructionToOffsetDictInitd = false;
     memoryStream.SetLength(0);
     memoryStream.Position = 0;
 }
示例#4
0
        /// <summary>
        /// Returns the raw custom debug info or null if there was an error
        /// </summary>
        /// <param name="metaData">Metadata</param>
        /// <param name="context">Writer context</param>
        /// <param name="method">Method</param>
        /// <param name="customDebugInfos">Custom debug infos to write</param>
        /// <returns></returns>
        public static byte[] Write(MetaData metaData, MethodDef method, PdbCustomDebugInfoWriterContext context, IList <PdbCustomDebugInfo> customDebugInfos)
        {
            var writer = new PdbCustomDebugInfoWriter(metaData, method, context);

            return(writer.Write(customDebugInfos));
        }