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

C# SymbolWriter.MonoSymbolFile类代码示例

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

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



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

示例1: LineNumberTable

		protected LineNumberTable(MonoSymbolFile file)
		{
			this.LineBase = file.OffsetTable.LineNumberTable_LineBase;
			this.LineRange = file.OffsetTable.LineNumberTable_LineRange;
			this.OpcodeBase = (byte)file.OffsetTable.LineNumberTable_OpcodeBase;
			this.MaxAddressIncrement = (int)(255 - this.OpcodeBase) / this.LineRange;
		}
开发者ID:FreshBirdZhe,项目名称:LSharp,代码行数:7,代码来源:LineNumberTable.cs


示例2: SourceFileEntry

 public SourceFileEntry(MonoSymbolFile file, string file_name)
 {
     this.file = file;
     this.file_name = file_name;
     this.Index = file.AddSource(this);
     this.creating = true;
 }
开发者ID:xqy,项目名称:game,代码行数:7,代码来源:SourceFileEntry.cs


示例3: MonoSymbolWriter

		public MonoSymbolWriter (Stream stream)
		{
			this.stream = stream;
			this.methods = new List<SourceMethodBuilder> ();
			this.sources = new List<SourceFileEntry> ();
			this.comp_units = new List<CompileUnitEntry> ();
			this.file = new MonoSymbolFile ();
		}
开发者ID:cupsster,项目名称:Unity3D.IncrementalCompiler,代码行数:8,代码来源:MonoSymbolWriter.cs


示例4: CompileUnitEntry

		public CompileUnitEntry(MonoSymbolFile file, SourceFileEntry source)
		{
			this.file = file;
			this.source = source;
			this.Index = file.AddCompileUnit(this);
			this.creating = true;
			this.namespaces = new List<NamespaceEntry>();
		}
开发者ID:FreshBirdZhe,项目名称:LSharp,代码行数:8,代码来源:CompileUnitEntry.cs


示例5: MonoSymbolWriter

		public MonoSymbolWriter (string filename)
		{
			this.methods = new List<SourceMethodBuilder> ();
			this.sources = new List<SourceFileEntry> ();
			this.comp_units = new List<CompileUnitEntry> ();
			this.file = new MonoSymbolFile ();

			this.filename = filename + ".mdb";
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:9,代码来源:MonoSymbolWriter.cs


示例6: MonoSymbolWriter

		public MonoSymbolWriter (string filename)
		{
			this.methods = new ArrayList ();
			this.sources = new ArrayList ();
			this.comp_units = new ArrayList ();
			this.current_method_stack = new Stack ();
			this.file = new MonoSymbolFile ();

			this.filename = filename + ".mdb";
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:10,代码来源:MonoSymbolWriter.cs


示例7: NamespaceEntry

		internal NamespaceEntry(MonoSymbolFile file, MyBinaryReader reader)
		{
			this.Name = reader.ReadString();
			this.Index = reader.ReadLeb128();
			this.Parent = reader.ReadLeb128();
			int count = reader.ReadLeb128();
			this.UsingClauses = new string[count];
			for (int i = 0; i < count; i++)
			{
				this.UsingClauses[i] = reader.ReadString();
			}
		}
开发者ID:qq1792,项目名称:LSharp,代码行数:12,代码来源:NamespaceEntry.cs


示例8: MethodEntry

		internal MethodEntry(MonoSymbolFile file, CompileUnitEntry comp_unit, int token, ScopeVariable[] scope_vars, LocalVariableEntry[] locals, LineNumberEntry[] lines, CodeBlockEntry[] code_blocks, string real_name, MethodEntry.Flags flags, int namespace_id)
		{
			this.SymbolFile = file;
			this.real_name = real_name;
			this.locals = locals;
			this.code_blocks = code_blocks;
			this.scope_vars = scope_vars;
			this.flags = flags;
			this.index = -1;
			this.Token = token;
			this.CompileUnitIndex = comp_unit.Index;
			this.CompileUnit = comp_unit;
			this.NamespaceID = namespace_id;
			this.CheckLineNumberTable(lines);
			this.lnt = new LineNumberTable(file, lines);
			file.NumLineNumbers += lines.Length;
			int num_locals = (locals != null) ? locals.Length : 0;
			if (num_locals <= 32)
			{
				for (int i = 0; i < num_locals; i++)
				{
					string nm = locals[i].Name;
					for (int j = i + 1; j < num_locals; j++)
					{
						if (locals[j].Name == nm)
						{
							flags |= MethodEntry.Flags.LocalNamesAmbiguous;
							goto IL_108;
						}
					}
				}
				IL_108:;
			}
			else
			{
				Dictionary<string, LocalVariableEntry> local_names = new Dictionary<string, LocalVariableEntry>();
				for (int k = 0; k < locals.Length; k++)
				{
					LocalVariableEntry local = locals[k];
					if (local_names.ContainsKey(local.Name))
					{
						flags |= MethodEntry.Flags.LocalNamesAmbiguous;
						break;
					}
					local_names.Add(local.Name, local);
				}
			}
		}
开发者ID:qq1792,项目名称:LSharp,代码行数:48,代码来源:MethodEntry.cs


示例9: RewriteMdbFile

		public void RewriteMdbFile (string inputFile)
		{
			if (!settings.Quiet)
				Console.WriteLine ("Processing {0}", inputFile);
			var input = MonoSymbolFile.ReadSymbolFile (inputFile);

			var output = new MonoSymbolFile ();

			foreach (var s in input.Sources) {
				var newFileName = settings.FileNamesOnly
					? Path.Combine (Path.GetDirectoryName (s.FileName), settings.Replace (Path.GetFileName (s.FileName)))
					: settings.Replace (s.FileName);

				if (settings.Verbose)
					Console.WriteLine ("{0} -> {1}", s.FileName, newFileName);

				s.FileName = newFileName;
				output.AddSource (s);
			}

			foreach (var cu in input.CompileUnits) {
				cu.ReadAll ();
				output.AddCompileUnit (cu);
			}
		
			foreach (var m in input.Methods) {
				m.ReadAll ();
				output.AddMethod (m);
			}


			var mdbName = new FileInfo (inputFile).Name;
			var tmpMdb = Path.GetTempFileName ();
			var finalMdb = inputFile;
			if (settings.OutputDirectory != null)
				finalMdb = Path.Combine (settings.OutputDirectory, mdbName);

			using (var stream = new FileStream (tmpMdb, FileMode.Create)) {
				output.CreateSymbolFile (input.Guid, stream);
			}
			input.Dispose ();

			File.Delete (finalMdb);
			File.Move (tmpMdb, finalMdb);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:45,代码来源:mdbrebase.cs


示例10: MdbRebase

        static void MdbRebase(string mdbFile, string toRemove)
        {
            #if WINDOWS_BUILD
            Console.Error.WriteLine ("Warning: skipping MDB rebasing of {0} (not supported on Windows)", mdbFile);
            #else
            using (var input = MonoSymbolFile.ReadSymbolFile (mdbFile)) {
                var output = new MonoSymbolFile ();

                foreach (var source in input.Sources) {
                    source.FileName = Path.Combine (
                        Path.GetDirectoryName (source.FileName),
                        Path.GetFileName (source.FileName).Replace (toRemove, String.Empty)
                    );

                    output.AddSource (source);
                }

                foreach (var compileUnit in input.CompileUnits) {
                    compileUnit.ReadAll ();
                    output.AddCompileUnit (compileUnit);
                }

                foreach (var method in input.Methods) {
                    method.ReadAll ();
                    output.AddMethod (method);
                }

                var tmpMdb = Path.GetTempFileName ();

                using (var stream = new FileStream (tmpMdb, FileMode.Create))
                    output.CreateSymbolFile (input.Guid, stream);

                File.Delete (mdbFile);
                File.Move (tmpMdb, mdbFile);
            }
            #endif
        }
开发者ID:yudhitech,项目名称:xamarin-macios,代码行数:37,代码来源:Driver.cs


示例11: CreateUnitSymbolInfo

        //
        // Creates symbol file index in debug symbol file
        //
        void CreateUnitSymbolInfo(MonoSymbolFile symwriter)
        {
            var si = file.CreateSymbolInfo (symwriter);
            comp_unit = new CompileUnitEntry (symwriter, si);

            if (include_files != null) {
                foreach (SourceFile include in include_files.Values) {
                    si = include.CreateSymbolInfo (symwriter);
                    comp_unit.AddFile (si);
                }
            }
        }
开发者ID:exodrifter,项目名称:mcs-ICodeCompiler,代码行数:15,代码来源:namespace.cs


示例12: MdbReader

		public MdbReader (MonoSymbolFile symFile)
		{
			symbol_file = symFile;
			documents = new Dictionary<string, Document> ();
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:MdbReader.cs


示例13: WriteDebugSymbol

		public virtual void WriteDebugSymbol (MonoSymbolFile file)
		{
		}
开发者ID:johnluetke,项目名称:mono,代码行数:3,代码来源:decl.cs


示例14: WriteDebugSymbol

		public override void WriteDebugSymbol (MonoSymbolFile file)
		{
			if (debug_builder == null)
				return;

			var token = ConstructorBuilder.GetToken ();
			int t = token.Token;
#if STATIC
			if (token.IsPseudoToken)
				t = Module.Builder.ResolvePseudoToken (t);
#endif

			debug_builder.DefineMethod (file, t);
		}
开发者ID:Viewserve,项目名称:mono,代码行数:14,代码来源:method.cs


示例15: DefineMethod

		public void DefineMethod (MonoSymbolFile file, int token)
		{
			MethodEntry entry = new MethodEntry (
				file, _comp_unit.Entry, token, ScopeVariables,
				Locals, method_lines.ToArray (), Blocks, null, MethodEntry.Flags.ColumnsInfoIncluded, ns_id);

			file.AddMethod (entry);
		}
开发者ID:dyxu,项目名称:vimrc,代码行数:8,代码来源:SourceMethodBuilder.cs


示例16: WriteDebugSymbol

		public override void WriteDebugSymbol (MonoSymbolFile file)
		{
			if (IsPartialPart)
				return;

			foreach (var m in members) {
				m.WriteDebugSymbol (file);
			}
		}
开发者ID:fvalette,项目名称:mono,代码行数:9,代码来源:class.cs


示例17: WriteDebugSymbol

		public void WriteDebugSymbol (MonoSymbolFile file)
		{
			if (debug_builder == null)
				return;

			var token = builder.GetToken ();
			int t = token.Token;
#if STATIC
			if (ModuleBuilder.IsPseudoToken (t))
				t = member.Module.Builder.ResolvePseudoToken (t);
#endif

			debug_builder.DefineMethod (file, t);
		}
开发者ID:OpenFlex,项目名称:playscript-mono,代码行数:14,代码来源:method.cs


示例18: WriteDebugSymbol

		public override void WriteDebugSymbol (MonoSymbolFile file)
		{
			if (get != null)
				get.WriteDebugSymbol (file);

			if (set != null)
				set.WriteDebugSymbol (file);
		}
开发者ID:bbqchickenrobot,项目名称:playscript-mono,代码行数:8,代码来源:property.cs


示例19: ConvertSymbolFileToXml

		static void ConvertSymbolFileToXml (MonoSymbolFile symbolFile, string xmlFile)
		{
			using (XmlTextWriter writer = new XmlTextWriter (xmlFile, Encoding.UTF8)) {
				writer.Formatting = Formatting.Indented;

				writer.WriteStartDocument ();

				writer.WriteStartElement ("symbols");

				writer.WriteStartElement ("files");
				foreach (var file in symbolFile.Sources) {
					writer.WriteStartElement ("file");
					writer.WriteAttributeString ("id", file.Index.ToString ());
					writer.WriteAttributeString ("name", Path.GetFileName (file.FileName));
					var checksum = file.Checksum;
					if (checksum != null)
						writer.WriteAttributeString ("checksum", ChecksumToString (checksum));

					writer.WriteEndElement ();
				}
				writer.WriteEndElement ();

				writer.WriteStartElement ("methods");
				foreach (var method in symbolFile.Methods) {
					writer.WriteStartElement ("method");
					writer.WriteAttributeString ("token", IntToHex (method.Token));

					var il_entries = method.GetLineNumberTable ();
					writer.WriteStartElement ("sequencepoints");
					foreach (var entry in il_entries.LineNumbers) {
						writer.WriteStartElement ("entry");
						writer.WriteAttributeString ("il", IntToHex (entry.Offset));
						writer.WriteAttributeString ("row", entry.Row.ToString ());
						writer.WriteAttributeString ("col", entry.Column.ToString ());
						writer.WriteAttributeString ("file_ref", entry.File.ToString ());
						writer.WriteAttributeString ("hidden", BoolToString (entry.IsHidden));
						writer.WriteEndElement ();
					}
					writer.WriteEndElement ();

					writer.WriteStartElement ("locals");
					foreach (var local in method.GetLocals ()) {
						writer.WriteStartElement ("entry");
						writer.WriteAttributeString ("name", local.Name);
						writer.WriteAttributeString ("il_index", local.Index.ToString ());
						writer.WriteAttributeString ("scope_ref", local.BlockIndex.ToString ());
						writer.WriteEndElement ();
					}
					writer.WriteEndElement ();

					writer.WriteStartElement ("scopes");
					foreach (var scope in method.GetCodeBlocks ()) {
						writer.WriteStartElement ("entry");
						writer.WriteAttributeString ("index", scope.Index.ToString ());
						writer.WriteAttributeString ("start", IntToHex (scope.StartOffset));
						writer.WriteAttributeString ("end", IntToHex (scope.EndOffset));
						writer.WriteEndElement ();
					}
					writer.WriteEndElement ();

					writer.WriteEndElement ();
				}
				writer.WriteEndElement ();

				writer.WriteEndElement ();
				writer.WriteEndDocument ();
			}
		}
开发者ID:jakesays,项目名称:mono,代码行数:68,代码来源:compiler-tester.cs


示例20: Write

		internal void Write (MonoSymbolFile file, MyBinaryWriter bw)
		{
			int start = (int) bw.BaseStream.Position;

			bool last_is_hidden = false;
			int last_line = 1, last_offset = 0, last_file = 1;
			for (int i = 0; i < LineNumbers.Length; i++) {
				int line_inc = LineNumbers [i].Row - last_line;
				int offset_inc = LineNumbers [i].Offset - last_offset;

				if (SuppressDuplicates && (i+1 < LineNumbers.Length)) {
					if (LineNumbers [i+1].Equals (LineNumbers [i]))
						continue;
				}

				if (LineNumbers [i].File != last_file) {
					bw.Write (DW_LNS_set_file);
					bw.WriteLeb128 (LineNumbers [i].File);
					last_file = LineNumbers [i].File;
				}

				if (LineNumbers [i].IsHidden != last_is_hidden) {
					bw.Write ((byte) 0);
					bw.Write ((byte) 1);
					bw.Write (DW_LNE_MONO_negate_is_hidden);
					last_is_hidden = LineNumbers [i].IsHidden;
				}

				if (offset_inc >= MaxAddressIncrement) {
					if (offset_inc < 2 * MaxAddressIncrement) {
						bw.Write (DW_LNS_const_add_pc);
						offset_inc -= MaxAddressIncrement;
					} else {
						bw.Write (DW_LNS_advance_pc);
						bw.WriteLeb128 (offset_inc);
						offset_inc = 0;
					}
				}

				if ((line_inc < LineBase) || (line_inc >= LineBase + LineRange)) {
					bw.Write (DW_LNS_advance_line);
					bw.WriteLeb128 (line_inc);
					if (offset_inc != 0) {
						bw.Write (DW_LNS_advance_pc);
						bw.WriteLeb128 (offset_inc);
					}
					bw.Write (DW_LNS_copy);
				} else {
					byte opcode;
					opcode = (byte) (line_inc - LineBase + (LineRange * offset_inc) +
							 OpcodeBase);
					bw.Write (opcode);
				}

				last_line = LineNumbers [i].Row;
				last_offset = LineNumbers [i].Offset;
			}

			bw.Write ((byte) 0);
			bw.Write ((byte) 1);
			bw.Write (DW_LNE_end_sequence);

			file.ExtendedLineNumberSize += (int) bw.BaseStream.Position - start;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:64,代码来源:MonoSymbolTable.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# SymbolWriter.SourceFileEntry类代码示例发布时间:2022-05-26
下一篇:
C# SymbolWriter.MethodEntry类代码示例发布时间: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