Permalink
Browse files

Switch Cecil to common git://github.com/mono/cecil.git

  • Loading branch information...
1 parent 97cc622 commit 12a948c37fd3687a51ee299598d8be642cd94672 @marek-safar marek-safar committed Apr 27, 2012
Showing with 139 additions and 28,021 deletions.
  1. +3 −0 .gitmodules
  2. +1 −0 external/cecil
  3. +1 −3 mcs/class/Mono.Cecil.Mdb/Makefile
  4. +7 −7 mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb.dll.sources
  5. +0 −41 mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb/AssemblyInfo.cs
  6. +0 −213 mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb/MdbReader.cs
  7. +0 −251 mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb/MdbWriter.cs
  8. +0 −7 mcs/class/Mono.Cecil/.gitignore
  9. +0 −252 mcs/class/Mono.Cecil/Mono.Cecil.Cil/Code.cs
  10. +0 −598 mcs/class/Mono.Cecil/Mono.Cecil.Cil/CodeReader.cs
  11. +0 −649 mcs/class/Mono.Cecil/Mono.Cecil.Cil/CodeWriter.cs
  12. +0 −112 mcs/class/Mono.Cecil/Mono.Cecil.Cil/Document.cs
  13. +0 −89 mcs/class/Mono.Cecil/Mono.Cecil.Cil/ExceptionHandler.cs
  14. +0 −278 mcs/class/Mono.Cecil/Mono.Cecil.Cil/ILProcessor.cs
  15. +0 −321 mcs/class/Mono.Cecil/Mono.Cecil.Cil/Instruction.cs
  16. +0 −241 mcs/class/Mono.Cecil/Mono.Cecil.Cil/MethodBody.cs
  17. +0 −455 mcs/class/Mono.Cecil/Mono.Cecil.Cil/OpCode.cs
  18. +0 −912 mcs/class/Mono.Cecil/Mono.Cecil.Cil/OpCodes.cs
  19. +0 −70 mcs/class/Mono.Cecil/Mono.Cecil.Cil/SequencePoint.cs
  20. +0 −277 mcs/class/Mono.Cecil/Mono.Cecil.Cil/Symbols.cs
  21. +0 −52 mcs/class/Mono.Cecil/Mono.Cecil.Cil/VariableDefinition.cs
  22. +0 −75 mcs/class/Mono.Cecil/Mono.Cecil.Cil/VariableReference.cs
  23. +0 −59 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/BlobHeap.cs
  24. +0 −373 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/Buffers.cs
  25. +0 −46 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/CodedIndex.cs
  26. +0 −73 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/ElementType.cs
  27. +0 −59 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/GuidHeap.cs
  28. +0 −48 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/Heap.cs
  29. +0 −105 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/MetadataToken.cs
  30. +0 −170 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/Row.cs
  31. +0 −81 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/StringHeap.cs
  32. +0 −111 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/TableHeap.cs
  33. +0 −56 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/TokenType.cs
  34. +0 −59 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/UserStringHeap.cs
  35. +0 −529 mcs/class/Mono.Cecil/Mono.Cecil.Metadata/Utilities.cs
  36. +0 −51 mcs/class/Mono.Cecil/Mono.Cecil.PE/BinaryStreamReader.cs
  37. +0 −96 mcs/class/Mono.Cecil/Mono.Cecil.PE/BinaryStreamWriter.cs
  38. +0 −359 mcs/class/Mono.Cecil/Mono.Cecil.PE/ByteBuffer.cs
  39. +0 −78 mcs/class/Mono.Cecil/Mono.Cecil.PE/ByteBufferEqualityComparer.cs
  40. +0 −50 mcs/class/Mono.Cecil/Mono.Cecil.PE/DataDirectory.cs
  41. +0 −160 mcs/class/Mono.Cecil/Mono.Cecil.PE/Image.cs
  42. +0 −679 mcs/class/Mono.Cecil/Mono.Cecil.PE/ImageReader.cs
  43. +0 −823 mcs/class/Mono.Cecil/Mono.Cecil.PE/ImageWriter.cs
  44. +0 −43 mcs/class/Mono.Cecil/Mono.Cecil.PE/Section.cs
  45. +0 −129 mcs/class/Mono.Cecil/Mono.Cecil.PE/TextMap.cs
  46. +127 −127 mcs/class/Mono.Cecil/Mono.Cecil.dll.sources
  47. +0 −159 mcs/class/Mono.Cecil/Mono.Cecil/ArrayType.cs
  48. +0 −189 mcs/class/Mono.Cecil/Mono.Cecil/AssemblyDefinition.cs
  49. +0 −42 mcs/class/Mono.Cecil/Mono.Cecil/AssemblyFlags.cs
  50. +0 −36 mcs/class/Mono.Cecil/Mono.Cecil/AssemblyHashAlgorithm.cs
  51. +0 −49 mcs/class/Mono.Cecil/Mono.Cecil/AssemblyInfo.cs
  52. +0 −57 mcs/class/Mono.Cecil/Mono.Cecil/AssemblyLinkedResource.cs
  53. +0 −50 mcs/class/Mono.Cecil/Mono.Cecil/AssemblyNameDefinition.cs
  54. +0 −268 mcs/class/Mono.Cecil/Mono.Cecil/AssemblyNameReference.cs
  55. +0 −3,161 mcs/class/Mono.Cecil/Mono.Cecil/AssemblyReader.cs
  56. +0 −2,571 mcs/class/Mono.Cecil/Mono.Cecil/AssemblyWriter.cs
  57. +0 −363 mcs/class/Mono.Cecil/Mono.Cecil/BaseAssemblyResolver.cs
  58. +0 −124 mcs/class/Mono.Cecil/Mono.Cecil/CallSite.cs
  59. +0 −232 mcs/class/Mono.Cecil/Mono.Cecil/CustomAttribute.cs
  60. +0 −75 mcs/class/Mono.Cecil/Mono.Cecil/DefaultAssemblyResolver.cs
  61. +0 −105 mcs/class/Mono.Cecil/Mono.Cecil/EmbeddedResource.cs
  62. +0 −39 mcs/class/Mono.Cecil/Mono.Cecil/EventAttributes.cs
  63. +0 −168 mcs/class/Mono.Cecil/Mono.Cecil/EventDefinition.cs
  64. +0 −57 mcs/class/Mono.Cecil/Mono.Cecil/EventReference.cs
  65. +0 −249 mcs/class/Mono.Cecil/Mono.Cecil/ExportedType.cs
  66. +0 −59 mcs/class/Mono.Cecil/Mono.Cecil/FieldAttributes.cs
  67. +0 −279 mcs/class/Mono.Cecil/Mono.Cecil/FieldDefinition.cs
  68. +0 −83 mcs/class/Mono.Cecil/Mono.Cecil/FieldReference.cs
  69. +0 −35 mcs/class/Mono.Cecil/Mono.Cecil/FileAttributes.cs
  70. +0 −128 mcs/class/Mono.Cecil/Mono.Cecil/FunctionPointerType.cs
  71. +0 −85 mcs/class/Mono.Cecil/Mono.Cecil/GenericInstanceMethod.cs
  72. +0 −83 mcs/class/Mono.Cecil/Mono.Cecil/GenericInstanceType.cs
  73. +0 −277 mcs/class/Mono.Cecil/Mono.Cecil/GenericParameter.cs
  74. +0 −45 mcs/class/Mono.Cecil/Mono.Cecil/GenericParameterAttributes.cs
  75. +0 −52 mcs/class/Mono.Cecil/Mono.Cecil/IConstantProvider.cs
  76. +0 −60 mcs/class/Mono.Cecil/Mono.Cecil/ICustomAttributeProvider.cs
  77. +0 −66 mcs/class/Mono.Cecil/Mono.Cecil/IGenericInstance.cs
  78. +0 −73 mcs/class/Mono.Cecil/Mono.Cecil/IGenericParameterProvider.cs
  79. +0 −55 mcs/class/Mono.Cecil/Mono.Cecil/IMarshalInfoProvider.cs
  80. +0 −100 mcs/class/Mono.Cecil/Mono.Cecil/IMemberDefinition.cs
  81. +0 −41 mcs/class/Mono.Cecil/Mono.Cecil/IMetadataScope.cs
  82. +0 −35 mcs/class/Mono.Cecil/Mono.Cecil/IMetadataTokenProvider.cs
  83. +0 −75 mcs/class/Mono.Cecil/Mono.Cecil/IMethodSignature.cs
  84. +0 −566 mcs/class/Mono.Cecil/Mono.Cecil/Import.cs
  85. +0 −60 mcs/class/Mono.Cecil/Mono.Cecil/LinkedResource.cs
  86. +0 −39 mcs/class/Mono.Cecil/Mono.Cecil/ManifestResourceAttributes.cs
  87. +0 −171 mcs/class/Mono.Cecil/Mono.Cecil/MarshalInfo.cs
  88. +0 −92 mcs/class/Mono.Cecil/Mono.Cecil/MemberDefinitionCollection.cs
  89. +0 −101 mcs/class/Mono.Cecil/Mono.Cecil/MemberReference.cs
  90. +0 −364 mcs/class/Mono.Cecil/Mono.Cecil/MetadataResolver.cs
  91. +0 −398 mcs/class/Mono.Cecil/Mono.Cecil/MetadataSystem.cs
  92. +0 −66 mcs/class/Mono.Cecil/Mono.Cecil/MethodAttributes.cs
  93. +0 −40 mcs/class/Mono.Cecil/Mono.Cecil/MethodCallingConvention.cs
  94. +0 −487 mcs/class/Mono.Cecil/Mono.Cecil/MethodDefinition.cs
  95. +0 −53 mcs/class/Mono.Cecil/Mono.Cecil/MethodImplAttributes.cs
  96. +0 −214 mcs/class/Mono.Cecil/Mono.Cecil/MethodReference.cs
  97. +0 −104 mcs/class/Mono.Cecil/Mono.Cecil/MethodReturnType.cs
  98. +0 −43 mcs/class/Mono.Cecil/Mono.Cecil/MethodSemanticsAttributes.cs
  99. +0 −103 mcs/class/Mono.Cecil/Mono.Cecil/MethodSpecification.cs
  100. +0 −137 mcs/class/Mono.Cecil/Mono.Cecil/Modifiers.cs
  101. +0 −1,048 mcs/class/Mono.Cecil/Mono.Cecil/ModuleDefinition.cs
  102. +0 −54 mcs/class/Mono.Cecil/Mono.Cecil/ModuleKind.cs
  103. +0 −67 mcs/class/Mono.Cecil/Mono.Cecil/ModuleReference.cs
  104. +0 −73 mcs/class/Mono.Cecil/Mono.Cecil/NativeType.cs
  105. +0 −62 mcs/class/Mono.Cecil/Mono.Cecil/PInvokeAttributes.cs
  106. +0 −138 mcs/class/Mono.Cecil/Mono.Cecil/PInvokeInfo.cs
  107. +0 −45 mcs/class/Mono.Cecil/Mono.Cecil/ParameterAttributes.cs
  108. +0 −172 mcs/class/Mono.Cecil/Mono.Cecil/ParameterDefinition.cs
  109. +0 −80 mcs/class/Mono.Cecil/Mono.Cecil/ParameterDefinitionCollection.cs
  110. +0 −75 mcs/class/Mono.Cecil/Mono.Cecil/ParameterReference.cs
  111. +0 −53 mcs/class/Mono.Cecil/Mono.Cecil/PinnedType.cs
  112. +0 −61 mcs/class/Mono.Cecil/Mono.Cecil/PointerType.cs
  113. +0 −41 mcs/class/Mono.Cecil/Mono.Cecil/PropertyAttributes.cs
  114. +0 −265 mcs/class/Mono.Cecil/Mono.Cecil/PropertyDefinition.cs
  115. +0 −59 mcs/class/Mono.Cecil/Mono.Cecil/PropertyReference.cs
  116. +0 −61 mcs/class/Mono.Cecil/Mono.Cecil/ReferenceType.cs
  117. +0 −76 mcs/class/Mono.Cecil/Mono.Cecil/Resource.cs
  118. +0 −191 mcs/class/Mono.Cecil/Mono.Cecil/SecurityDeclaration.cs
  119. +0 −53 mcs/class/Mono.Cecil/Mono.Cecil/SentinelType.cs
  120. +0 −37 mcs/class/Mono.Cecil/Mono.Cecil/TargetRuntime.cs
  121. +0 −81 mcs/class/Mono.Cecil/Mono.Cecil/TypeAttributes.cs
  122. +0 −517 mcs/class/Mono.Cecil/Mono.Cecil/TypeDefinition.cs
  123. +0 −118 mcs/class/Mono.Cecil/Mono.Cecil/TypeDefinitionCollection.cs
  124. +0 −555 mcs/class/Mono.Cecil/Mono.Cecil/TypeParser.cs
  125. +0 −330 mcs/class/Mono.Cecil/Mono.Cecil/TypeReference.cs
  126. +0 −94 mcs/class/Mono.Cecil/Mono.Cecil/TypeSpecification.cs
  127. +0 −265 mcs/class/Mono.Cecil/Mono.Cecil/TypeSystem.cs
  128. +0 −53 mcs/class/Mono.Cecil/Mono.Cecil/VariantType.cs
  129. +0 −420 mcs/class/Mono.Cecil/Mono.Collections.Generic/Collection.cs
  130. +0 −112 mcs/class/Mono.Cecil/Mono.Collections.Generic/ReadOnlyCollection.cs
  131. +0 −243 mcs/class/Mono.Cecil/Mono.Security.Cryptography/CryptoConvert.cs
  132. +0 −177 mcs/class/Mono.Cecil/Mono.Security.Cryptography/CryptoService.cs
  133. +0 −38 mcs/class/Mono.Cecil/Mono/Actions.cs
  134. +0 −53 mcs/class/Mono.Cecil/Mono/Empty.cs
  135. +0 −39 mcs/class/Mono.Cecil/Mono/Funcs.cs
  136. +0 −189 mcs/class/Mono.Cecil/NOTES.txt
  137. +0 −15 mcs/class/Mono.Cecil/README
  138. +0 −40 mcs/class/Mono.Cecil/System.Runtime.CompilerServices/ExtensionAttribute.cs
  139. BIN mcs/class/Mono.Cecil/mono.snk
  140. +0 −1 mcs/class/Mono.Cecil/revision
  141. +0 −40 mcs/class/Mono.Cecil/update.rb
View
@@ -4,3 +4,6 @@
[submodule "external/Newtonsoft.Json"]
path = external/Newtonsoft.Json
url = git://github.com/mono/Newtonsoft.Json.git
+[submodule "external/cecil"]
+ path = external/cecil
+ url = git://github.com/mono/cecil.git
Submodule cecil added at 54e0a5
@@ -5,9 +5,7 @@ LIBRARY = Mono.Cecil.Mdb.dll
LIBRARY_SNK = ../mono.snk
LIBRARY_PACKAGE = none
-CECIL = $(topdir)/class/lib/$(PROFILE)/Mono.Cecil.dll
-
-LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll /r:$(CECIL) /d:CECIL -keyfile:$(LIBRARY_SNK)
+LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll /r:Mono.Cecil.dll /d:CECIL -keyfile:$(LIBRARY_SNK)
NO_TEST = yes
@@ -1,7 +1,7 @@
-./Mono.Cecil.Mdb/AssemblyInfo.cs
-./Mono.Cecil.Mdb/MdbReader.cs
-./Mono.Cecil.Mdb/MdbWriter.cs
-../Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs
-../Mono.CompilerServices.SymbolWriter/MonoSymbolTable.cs
-../Mono.CompilerServices.SymbolWriter/MonoSymbolWriter.cs
-../Mono.CompilerServices.SymbolWriter/SourceMethodBuilder.cs
+../../../external/cecil/symbols/mdb/Mono.Cecil.Mdb/AssemblyInfo.cs
+../../../external/cecil/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
+../../../external/cecil/symbols/mdb/Mono.Cecil.Mdb/MdbWriter.cs
+../../../external/cecil/symbols/mdb/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs
+../../../external/cecil/symbols/mdb/Mono.CompilerServices.SymbolWriter/MonoSymbolTable.cs
+../../../external/cecil/symbols/mdb/Mono.CompilerServices.SymbolWriter/MonoSymbolWriter.cs
+../../../external/cecil/symbols/mdb/Mono.CompilerServices.SymbolWriter/SymbolWriterImpl.cs
@@ -1,41 +0,0 @@
-//
-// AssemblyInfo.cs
-//
-// Author:
-// Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyTitle ("Mono.Cecil.Mdb")]
-[assembly: AssemblyProduct ("Mono.Cecil")]
-[assembly: AssemblyCopyright ("Copyright © 2008 - 2011 Jb Evain")]
-
-[assembly: CLSCompliant (false)]
-[assembly: ComVisible (false)]
-
-[assembly: AssemblyVersion ("0.9.5.0")]
-[assembly: AssemblyFileVersion ("0.9.5.0")]
@@ -1,213 +0,0 @@
-//
-// MdbReader.cs
-//
-// Author:
-// Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-using Mono.Cecil.Cil;
-using Mono.Collections.Generic;
-using Mono.CompilerServices.SymbolWriter;
-
-namespace Mono.Cecil.Mdb {
-
- public class MdbReaderProvider : ISymbolReaderProvider {
-
- public ISymbolReader GetSymbolReader (ModuleDefinition module, string fileName)
- {
- return new MdbReader (MonoSymbolFile.ReadSymbolFile (fileName + ".mdb", module.Mvid));
- }
-
- public ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream)
- {
- throw new NotImplementedException ();
- }
- }
-
- public class MdbReader : ISymbolReader {
-
- readonly MonoSymbolFile symbol_file;
- readonly Dictionary<string, Document> documents;
-
- public MdbReader (MonoSymbolFile symFile)
- {
- symbol_file = symFile;
- documents = new Dictionary<string, Document> ();
- }
-
- public bool ProcessDebugHeader (ImageDebugDirectory directory, byte [] header)
- {
- return true;
- }
-
- public void Read (MethodBody body, InstructionMapper mapper)
- {
- var method_token = body.Method.MetadataToken;
- var entry = symbol_file.GetMethodByToken (method_token.ToInt32 ());
- if (entry == null)
- return;
-
- var scopes = ReadScopes (entry, body, mapper);
- ReadLineNumbers (entry, mapper);
- ReadLocalVariables (entry, body, scopes);
- }
-
- static void ReadLocalVariables (MethodEntry entry, MethodBody body, Scope [] scopes)
- {
- var locals = entry.GetLocals ();
- foreach (var local in locals) {
- var variable = body.Variables [local.Index];
- variable.Name = local.Name;
-
- var index = local.BlockIndex;
- if (index < 0 || index >= scopes.Length)
- continue;
-
- var scope = scopes [index];
- if (scope == null)
- continue;
-
- scope.Variables.Add (variable);
- }
- }
-
- void ReadLineNumbers (MethodEntry entry, InstructionMapper mapper)
- {
- Document document = null;
- var table = entry.GetLineNumberTable ();
-
- foreach (var line in table.LineNumbers) {
- var instruction = mapper (line.Offset);
- if (instruction == null)
- continue;
-
- if (document == null)
- document = GetDocument (entry.CompileUnit.SourceFile);
-
- instruction.SequencePoint = new SequencePoint (document) {
- StartLine = line.Row,
- EndLine = line.Row,
- };
- }
- }
-
- Document GetDocument (SourceFileEntry file)
- {
- var file_name = file.FileName;
-
- Document document;
- if (documents.TryGetValue (file_name, out document))
- return document;
-
- document = new Document (file_name);
- documents.Add (file_name, document);
-
- return document;
- }
-
- static Scope [] ReadScopes (MethodEntry entry, MethodBody body, InstructionMapper mapper)
- {
- var blocks = entry.GetCodeBlocks ();
- var scopes = new Scope [blocks.Length];
-
- foreach (var block in blocks) {
- if (block.BlockType != CodeBlockEntry.Type.Lexical)
- continue;
-
- var scope = new Scope ();
- scope.Start = mapper (block.StartOffset);
- scope.End = mapper (block.EndOffset);
-
- scopes [block.Index] = scope;
-
- if (body.Scope == null)
- body.Scope = scope;
-
- if (!AddScope (body.Scope, scope))
- body.Scope = scope;
- }
-
- return scopes;
- }
-
- static bool AddScope (Scope provider, Scope scope)
- {
- foreach (var sub_scope in provider.Scopes) {
- if (AddScope (sub_scope, scope))
- return true;
-
- if (scope.Start.Offset >= sub_scope.Start.Offset && scope.End.Offset <= sub_scope.End.Offset) {
- sub_scope.Scopes.Add (scope);
- return true;
- }
- }
-
- return false;
- }
-
- public void Read (MethodSymbols symbols)
- {
- var entry = symbol_file.GetMethodByToken (symbols.MethodToken.ToInt32 ());
- if (entry == null)
- return;
-
- ReadLineNumbers (entry, symbols);
- ReadLocalVariables (entry, symbols);
- }
-
- void ReadLineNumbers (MethodEntry entry, MethodSymbols symbols)
- {
- var table = entry.GetLineNumberTable ();
- var lines = table.LineNumbers;
-
- var instructions = symbols.instructions = new Collection<InstructionSymbol> (lines.Length);
-
- for (int i = 0; i < lines.Length; i++) {
- var line = lines [i];
-
- instructions.Add (new InstructionSymbol (line.Offset, new SequencePoint (GetDocument (entry.CompileUnit.SourceFile)) {
- StartLine = line.Row,
- EndLine = line.Row,
- }));
- }
- }
-
- static void ReadLocalVariables (MethodEntry entry, MethodSymbols symbols)
- {
- foreach (var local in entry.GetLocals ()) {
- var variable = symbols.Variables [local.Index];
- variable.Name = local.Name;
- }
- }
-
- public void Dispose ()
- {
- symbol_file.Dispose ();
- }
- }
-}
Oops, something went wrong.

0 comments on commit 12a948c

Please sign in to comment.