/src/netstandard/ref/System.Diagnostics.SymbolStore.cs

https://github.com/dotnet/standard · C# · 160 lines · 156 code · 1 blank · 3 comment · 0 complexity · cd982f1fe1bc4d62a11404b9adc481c9 MD5 · raw file

  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. namespace System.Diagnostics.SymbolStore
  5. {
  6. public partial interface ISymbolBinder
  7. {
  8. [System.ObsoleteAttribute("The recommended alternative is ISymbolBinder1.GetReader. ISymbolBinder1.GetReader takes the importer interface pointer as an IntPtr instead of an Int32, and thus works on both 32-bit and 64-bit architectures. https://go.microsoft.com/fwlink/?linkid=14202=14202")]
  9. System.Diagnostics.SymbolStore.ISymbolReader GetReader(int importer, string filename, string searchPath);
  10. }
  11. public partial interface ISymbolBinder1
  12. {
  13. System.Diagnostics.SymbolStore.ISymbolReader GetReader(System.IntPtr importer, string filename, string searchPath);
  14. }
  15. public partial interface ISymbolDocument
  16. {
  17. System.Guid CheckSumAlgorithmId { get; }
  18. System.Guid DocumentType { get; }
  19. bool HasEmbeddedSource { get; }
  20. System.Guid Language { get; }
  21. System.Guid LanguageVendor { get; }
  22. int SourceLength { get; }
  23. string URL { get; }
  24. int FindClosestLine(int line);
  25. byte[] GetCheckSum();
  26. byte[] GetSourceRange(int startLine, int startColumn, int endLine, int endColumn);
  27. }
  28. public partial interface ISymbolDocumentWriter
  29. {
  30. void SetCheckSum(System.Guid algorithmId, byte[] checkSum);
  31. void SetSource(byte[] source);
  32. }
  33. public partial interface ISymbolMethod
  34. {
  35. System.Diagnostics.SymbolStore.ISymbolScope RootScope { get; }
  36. int SequencePointCount { get; }
  37. System.Diagnostics.SymbolStore.SymbolToken Token { get; }
  38. System.Diagnostics.SymbolStore.ISymbolNamespace GetNamespace();
  39. int GetOffset(System.Diagnostics.SymbolStore.ISymbolDocument document, int line, int column);
  40. System.Diagnostics.SymbolStore.ISymbolVariable[] GetParameters();
  41. int[] GetRanges(System.Diagnostics.SymbolStore.ISymbolDocument document, int line, int column);
  42. System.Diagnostics.SymbolStore.ISymbolScope GetScope(int offset);
  43. void GetSequencePoints(int[] offsets, System.Diagnostics.SymbolStore.ISymbolDocument[] documents, int[] lines, int[] columns, int[] endLines, int[] endColumns);
  44. bool GetSourceStartEnd(System.Diagnostics.SymbolStore.ISymbolDocument[] docs, int[] lines, int[] columns);
  45. }
  46. public partial interface ISymbolNamespace
  47. {
  48. string Name { get; }
  49. System.Diagnostics.SymbolStore.ISymbolNamespace[] GetNamespaces();
  50. System.Diagnostics.SymbolStore.ISymbolVariable[] GetVariables();
  51. }
  52. public partial interface ISymbolReader
  53. {
  54. System.Diagnostics.SymbolStore.SymbolToken UserEntryPoint { get; }
  55. System.Diagnostics.SymbolStore.ISymbolDocument GetDocument(string url, System.Guid language, System.Guid languageVendor, System.Guid documentType);
  56. System.Diagnostics.SymbolStore.ISymbolDocument[] GetDocuments();
  57. System.Diagnostics.SymbolStore.ISymbolVariable[] GetGlobalVariables();
  58. System.Diagnostics.SymbolStore.ISymbolMethod GetMethod(System.Diagnostics.SymbolStore.SymbolToken method);
  59. System.Diagnostics.SymbolStore.ISymbolMethod GetMethod(System.Diagnostics.SymbolStore.SymbolToken method, int version);
  60. System.Diagnostics.SymbolStore.ISymbolMethod GetMethodFromDocumentPosition(System.Diagnostics.SymbolStore.ISymbolDocument document, int line, int column);
  61. System.Diagnostics.SymbolStore.ISymbolNamespace[] GetNamespaces();
  62. byte[] GetSymAttribute(System.Diagnostics.SymbolStore.SymbolToken parent, string name);
  63. System.Diagnostics.SymbolStore.ISymbolVariable[] GetVariables(System.Diagnostics.SymbolStore.SymbolToken parent);
  64. }
  65. public partial interface ISymbolScope
  66. {
  67. int EndOffset { get; }
  68. System.Diagnostics.SymbolStore.ISymbolMethod Method { get; }
  69. System.Diagnostics.SymbolStore.ISymbolScope Parent { get; }
  70. int StartOffset { get; }
  71. System.Diagnostics.SymbolStore.ISymbolScope[] GetChildren();
  72. System.Diagnostics.SymbolStore.ISymbolVariable[] GetLocals();
  73. System.Diagnostics.SymbolStore.ISymbolNamespace[] GetNamespaces();
  74. }
  75. public partial interface ISymbolVariable
  76. {
  77. int AddressField1 { get; }
  78. int AddressField2 { get; }
  79. int AddressField3 { get; }
  80. System.Diagnostics.SymbolStore.SymAddressKind AddressKind { get; }
  81. object Attributes { get; }
  82. int EndOffset { get; }
  83. string Name { get; }
  84. int StartOffset { get; }
  85. byte[] GetSignature();
  86. }
  87. public partial interface ISymbolWriter
  88. {
  89. void Close();
  90. void CloseMethod();
  91. void CloseNamespace();
  92. void CloseScope(int endOffset);
  93. System.Diagnostics.SymbolStore.ISymbolDocumentWriter DefineDocument(string url, System.Guid language, System.Guid languageVendor, System.Guid documentType);
  94. void DefineField(System.Diagnostics.SymbolStore.SymbolToken parent, string name, System.Reflection.FieldAttributes attributes, byte[] signature, System.Diagnostics.SymbolStore.SymAddressKind addrKind, int addr1, int addr2, int addr3);
  95. void DefineGlobalVariable(string name, System.Reflection.FieldAttributes attributes, byte[] signature, System.Diagnostics.SymbolStore.SymAddressKind addrKind, int addr1, int addr2, int addr3);
  96. void DefineLocalVariable(string name, System.Reflection.FieldAttributes attributes, byte[] signature, System.Diagnostics.SymbolStore.SymAddressKind addrKind, int addr1, int addr2, int addr3, int startOffset, int endOffset);
  97. void DefineParameter(string name, System.Reflection.ParameterAttributes attributes, int sequence, System.Diagnostics.SymbolStore.SymAddressKind addrKind, int addr1, int addr2, int addr3);
  98. void DefineSequencePoints(System.Diagnostics.SymbolStore.ISymbolDocumentWriter document, int[] offsets, int[] lines, int[] columns, int[] endLines, int[] endColumns);
  99. void Initialize(System.IntPtr emitter, string filename, bool fFullBuild);
  100. void OpenMethod(System.Diagnostics.SymbolStore.SymbolToken method);
  101. void OpenNamespace(string name);
  102. int OpenScope(int startOffset);
  103. void SetMethodSourceRange(System.Diagnostics.SymbolStore.ISymbolDocumentWriter startDoc, int startLine, int startColumn, System.Diagnostics.SymbolStore.ISymbolDocumentWriter endDoc, int endLine, int endColumn);
  104. void SetScopeRange(int scopeID, int startOffset, int endOffset);
  105. void SetSymAttribute(System.Diagnostics.SymbolStore.SymbolToken parent, string name, byte[] data);
  106. void SetUnderlyingWriter(System.IntPtr underlyingWriter);
  107. void SetUserEntryPoint(System.Diagnostics.SymbolStore.SymbolToken entryMethod);
  108. void UsingNamespace(string fullName);
  109. }
  110. public enum SymAddressKind
  111. {
  112. BitField = 9,
  113. ILOffset = 1,
  114. NativeOffset = 5,
  115. NativeRegister = 3,
  116. NativeRegisterRegister = 6,
  117. NativeRegisterRelative = 4,
  118. NativeRegisterStack = 7,
  119. NativeRVA = 2,
  120. NativeSectionOffset = 10,
  121. NativeStackRegister = 8,
  122. }
  123. public readonly partial struct SymbolToken
  124. {
  125. private readonly object _dummy;
  126. public SymbolToken(int val) { throw null; }
  127. public bool Equals(System.Diagnostics.SymbolStore.SymbolToken obj) { throw null; }
  128. public override bool Equals(object obj) { throw null; }
  129. public override int GetHashCode() { throw null; }
  130. public int GetToken() { throw null; }
  131. public static bool operator ==(System.Diagnostics.SymbolStore.SymbolToken a, System.Diagnostics.SymbolStore.SymbolToken b) { throw null; }
  132. public static bool operator !=(System.Diagnostics.SymbolStore.SymbolToken a, System.Diagnostics.SymbolStore.SymbolToken b) { throw null; }
  133. }
  134. public partial class SymDocumentType
  135. {
  136. public static readonly System.Guid Text;
  137. public SymDocumentType() { }
  138. }
  139. public partial class SymLanguageType
  140. {
  141. public static readonly System.Guid Basic;
  142. public static readonly System.Guid C;
  143. public static readonly System.Guid Cobol;
  144. public static readonly System.Guid CPlusPlus;
  145. public static readonly System.Guid CSharp;
  146. public static readonly System.Guid ILAssembly;
  147. public static readonly System.Guid Java;
  148. public static readonly System.Guid JScript;
  149. public static readonly System.Guid MCPlusPlus;
  150. public static readonly System.Guid Pascal;
  151. public static readonly System.Guid SMC;
  152. public SymLanguageType() { }
  153. }
  154. public partial class SymLanguageVendor
  155. {
  156. public static readonly System.Guid Microsoft;
  157. public SymLanguageVendor() { }
  158. }
  159. }