summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Diagnostics/SymbolStore
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Diagnostics/SymbolStore')
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/ISymBinder.cs42
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/ISymDocument.cs48
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/ISymDocumentWriter.cs31
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/ISymMethod.cs86
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/ISymNamespace.cs30
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/ISymReader.cs68
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/ISymScope.cs47
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/ISymVariable.cs41
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/ISymWriter.cs218
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs52
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/SymDocumentType.cs24
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/SymLanguageType.cs42
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/SymLanguageVendor.cs23
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/Token.cs51
14 files changed, 803 insertions, 0 deletions
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymBinder.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymBinder.cs
new file mode 100644
index 0000000000..1ce870f983
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymBinder.cs
@@ -0,0 +1,42 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+
+/*============================================================
+**
+**
+**
+** Represents a symbol binder for managed code.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+
+ using System;
+ using System.Text;
+ using System.Runtime.InteropServices;
+
+ // Interface does not need to be marked with the serializable attribute
+[System.Runtime.InteropServices.ComVisible(true)]
+ public interface ISymbolBinder
+ {
+ // The importer parameter should be an IntPtr, not an int. This interface can not be modified without
+ // a breaking change, and so ISymbolBinderEx.GetReader() has been added with the correct marshalling layout.
+ [Obsolete("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. http://go.microsoft.com/fwlink/?linkid=14202=14202")]
+ ISymbolReader GetReader(int importer, String filename,
+ String searchPath);
+ }
+
+ // This interface has a revised ISymbolBinder.GetReader() with the proper signature.
+ // It is not called ISymbolBinder2 because it maps to the IUnmanagedSymbolBinder interfaces, and
+ // does not wrap the IUnmanagedSymbolBinder2 interfaces declared in CorSym.idl.
+[System.Runtime.InteropServices.ComVisible(true)]
+ public interface ISymbolBinder1
+ {
+
+ ISymbolReader GetReader(IntPtr importer, String filename,
+ String searchPath);
+ }
+
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymDocument.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymDocument.cs
new file mode 100644
index 0000000000..c458b8e8a9
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymDocument.cs
@@ -0,0 +1,48 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Represents a document referenced by a symbol store. A document is
+** defined by a URL and a document type GUID. Using the document type
+** GUID and the URL, one can locate the document however it is
+** stored. Document source can optionally be stored in the symbol
+** store. This interface also provides access to that source if it is
+** present.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+
+ using System;
+
+ // Interface does not need to be marked with the serializable attribute
+[System.Runtime.InteropServices.ComVisible(true)]
+ public interface ISymbolDocument
+ {
+ // Properties of the document.
+ String URL { get; }
+ Guid DocumentType { get; }
+
+ // Language of the document.
+ Guid Language { get; }
+ Guid LanguageVendor { get; }
+
+ // Check sum information.
+ Guid CheckSumAlgorithmId { get; }
+ byte[] GetCheckSum();
+
+ // Given a line in this document that may or may not be a sequence
+ // point, return the closest line that is a sequence point.
+ int FindClosestLine(int line);
+
+ // Access to embedded source.
+ bool HasEmbeddedSource { get; }
+ int SourceLength { get; }
+ byte[] GetSourceRange(int startLine, int startColumn,
+ int endLine, int endColumn);
+ }
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymDocumentWriter.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymDocumentWriter.cs
new file mode 100644
index 0000000000..2b7b078dbc
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymDocumentWriter.cs
@@ -0,0 +1,31 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Represents a document referenced by a symbol store. A document is
+** defined by a URL and a document type GUID. Document source can
+** optionally be stored in the symbol store.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+
+ using System;
+
+ // Interface does not need to be marked with the serializable attribute
+ [System.Runtime.InteropServices.ComVisible(true)]
+ public interface ISymbolDocumentWriter
+ {
+ // SetSource will store the raw source for a document into the
+ // symbol store. An array of unsigned bytes is used instead of
+ // character data to accommodate a wider variety of "source".
+ void SetSource(byte[] source);
+
+ // Check sum support.
+ void SetCheckSum(Guid algorithmId, byte[] checkSum);
+ }
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymMethod.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymMethod.cs
new file mode 100644
index 0000000000..5edabb1194
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymMethod.cs
@@ -0,0 +1,86 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Represents a method within a symbol reader. This provides access to
+** only the symbol-related attributes of a method, such as sequence
+** points, lexical scopes, and parameter information. Use it in
+** conjucntion with other means to read the type-related attrbiutes of
+** a method, such as Reflections.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+ using System.Runtime.InteropServices;
+ using System;
+
+ // Interface does not need to be marked with the serializable attribute
+[System.Runtime.InteropServices.ComVisible(true)]
+ public interface ISymbolMethod
+ {
+ // Get the token for this method.
+ SymbolToken Token { get; }
+
+ // Get the count of sequence points.
+ int SequencePointCount { get; }
+
+ // Get the sequence points for this method. The sequence points
+ // are sorted by offset and are for all documents in the
+ // method. Use GetSequencePointCount to retrieve the count of all
+ // sequence points and create arrays of the proper size.
+ // GetSequencePoints will verify the size of each array and place
+ // the sequence point information into each. If any array is NULL,
+ // then the data for that array is simply not returned.
+ void GetSequencePoints(int[] offsets,
+ ISymbolDocument[] documents,
+ int[] lines,
+ int[] columns,
+ int[] endLines,
+ int[] endColumns);
+
+ // Get the root lexical scope for this method. This scope encloses
+ // the entire method.
+ ISymbolScope RootScope { get; }
+
+ // Given an offset within the method, returns the most enclosing
+ // lexical scope. This can be used to start local variable
+ // searches.
+ ISymbolScope GetScope(int offset);
+
+ // Given a position in a document, return the offset within the
+ // method that corresponds to the position.
+ int GetOffset(ISymbolDocument document,
+ int line,
+ int column);
+
+ // Given a position in a document, return an array of start/end
+ // offset paris that correspond to the ranges of IL that the
+ // position covers within this method. The array is an array of
+ // integers and is [start,end,start,end]. The number of range
+ // pairs is the length of the array / 2.
+ int[] GetRanges(ISymbolDocument document,
+ int line,
+ int column);
+
+ // Get the parameters for this method. The paraemeters are
+ // returned in the order they are defined within the method's
+ // signature.
+ ISymbolVariable[] GetParameters();
+
+ // Get the namespace that this method is defined within.
+ ISymbolNamespace GetNamespace();
+
+ // Get the start/end document positions for the source of this
+ // method. The first array position is the start while the second
+ // is the end. Returns true if positions were defined, false
+ // otherwise.
+ bool GetSourceStartEnd(ISymbolDocument[] docs,
+ int[] lines,
+ int[] columns);
+ }
+
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymNamespace.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymNamespace.cs
new file mode 100644
index 0000000000..1dee13ef69
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymNamespace.cs
@@ -0,0 +1,30 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Represents a namespace within a symbol reader.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+
+ using System;
+
+ // Interface does not need to be marked with the serializable attribute
+[System.Runtime.InteropServices.ComVisible(true)]
+ public interface ISymbolNamespace
+ {
+ // Get the name of this namespace
+ String Name { get; }
+
+ // Get the children of this namespace
+ ISymbolNamespace[] GetNamespaces();
+
+ // Get the variables in this namespace
+ ISymbolVariable[] GetVariables();
+ }
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymReader.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymReader.cs
new file mode 100644
index 0000000000..8bc75e5aba
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymReader.cs
@@ -0,0 +1,68 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Represents a symbol reader for managed code. Provides access to
+** documents, methods, and variables.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+ // Interface does not need to be marked with the serializable attribute
+ using System;
+ using System.Runtime.InteropServices;
+
+
+[System.Runtime.InteropServices.ComVisible(true)]
+ public interface ISymbolReader
+ {
+ // Find a document. Language, vendor, and document type are
+ // optional.
+ ISymbolDocument GetDocument(String url,
+ Guid language,
+ Guid languageVendor,
+ Guid documentType);
+
+ // Return an array of all of the documents defined in the symbol
+ // store.
+ ISymbolDocument[] GetDocuments();
+
+ // Return the method that was specified as the user entry point
+ // for the module, if any. This would be, perhaps, the user's main
+ // method rather than compiler generated stubs before main.
+ SymbolToken UserEntryPoint { get; }
+
+ // Get a symbol reader method given the id of a method.
+ ISymbolMethod GetMethod(SymbolToken method);
+
+ // Get a symbol reader method given the id of a method and an E&C
+ // version number. Version numbers start a 1 and are incremented
+ // each time the method is changed due to an E&C operation.
+ ISymbolMethod GetMethod(SymbolToken method, int version);
+
+ // Return a non-local variable given its parent and name.
+ ISymbolVariable[] GetVariables(SymbolToken parent);
+
+ // Return a non-local variable given its parent and name.
+ ISymbolVariable[] GetGlobalVariables();
+
+ // Given a position in a document, return the ISymbolMethod that
+ // contains that position.
+ ISymbolMethod GetMethodFromDocumentPosition(ISymbolDocument document,
+ int line,
+ int column);
+
+ // Gets a custom attribute based upon its name. Not to be
+ // confused with Metadata custom attributes, these attributes are
+ // held in the symbol store.
+ byte[] GetSymAttribute(SymbolToken parent, String name);
+
+ // Get the namespaces defined at global scope within this symbol store.
+ ISymbolNamespace[] GetNamespaces();
+ }
+
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymScope.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymScope.cs
new file mode 100644
index 0000000000..859d7d42c8
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymScope.cs
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Represents a lexical scope within a ISymbolMethod. Provides access to
+** the start and end offsets of the scope, as well as its child and
+** parent scopes. Also provides access to all the locals defined
+** within this scope.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+ // Interface does not need to be marked with the serializable attribute
+ using System;
+ using System.Text;
+ using System.Runtime.InteropServices;
+
+[System.Runtime.InteropServices.ComVisible(true)]
+ public interface ISymbolScope
+ {
+ // Get the method that contains this scope.
+ ISymbolMethod Method { get; }
+
+ // Get the parent scope of this scope.
+ ISymbolScope Parent { get; }
+
+ // Get any child scopes of this scope.
+ ISymbolScope[] GetChildren();
+
+ // Get the start and end offsets for this scope.
+ int StartOffset { get; }
+ int EndOffset { get; }
+
+ // Get the locals within this scope. They are returned in no
+ // particular order. Note: if a local variable changes its address
+ // within this scope then that variable will be returned multiple
+ // times, each with a different offset range.
+ ISymbolVariable[] GetLocals();
+
+ // Get the namespaces that are being "used" within this scope.
+ ISymbolNamespace[] GetNamespaces();
+ }
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymVariable.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymVariable.cs
new file mode 100644
index 0000000000..857d24b2b6
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymVariable.cs
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Represents a variable within a symbol store. This could be a
+** parameter, local variable, or some other non-local variable.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+ // Interface does not need to be marked with the serializable attribute
+ using System;
+
+[System.Runtime.InteropServices.ComVisible(true)]
+ public interface ISymbolVariable
+ {
+ // Get the name of this variable.
+ String Name { get; }
+
+ // Get the attributes of this variable.
+ Object Attributes { get; }
+
+ // Get the signature of this variable.
+ byte[] GetSignature();
+
+ SymAddressKind AddressKind { get; }
+ int AddressField1 { get; }
+ int AddressField2 { get; }
+ int AddressField3 { get; }
+
+ // Get the start/end offsets of this variable within its
+ // parent. If this is a local variable within a scope, these will
+ // fall within the offsets defined for the scope.
+ int StartOffset { get; }
+ int EndOffset { get; }
+ }
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymWriter.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymWriter.cs
new file mode 100644
index 0000000000..b6177be2aa
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymWriter.cs
@@ -0,0 +1,218 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Represents a symbol writer for managed code. Provides methods to
+** define documents, sequence points, lexical scopes, and variables.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+
+ using System;
+ using System.Text;
+ using System.Reflection;
+ using System.Runtime.InteropServices;
+ using System.Runtime.Versioning;
+
+ // Interface does not need to be marked with the serializable attribute
+[System.Runtime.InteropServices.ComVisible(true)]
+ public interface ISymbolWriter
+ {
+ // Set the IMetadataEmitter that this symbol writer is associated
+ // with. This must be done only once before any other ISymbolWriter
+ // methods are called.
+ void Initialize(IntPtr emitter, String filename, bool fFullBuild);
+
+ // Define a source document. Guid's will be provided for the
+ // languages, vendors, and document types that we currently know
+ // about.
+ #if FEATURE_CORECLR
+ [System.Security.SecurityCritical] // auto-generated
+ #endif
+ ISymbolDocumentWriter DefineDocument(String url,
+ Guid language,
+ Guid languageVendor,
+ Guid documentType);
+
+ // Define the method that the user has defined as their entrypoint
+ // for this module. This would be, perhaps, the user's main method
+ // rather than compiler generated stubs before main.
+ #if FEATURE_CORECLR
+ [System.Security.SecurityCritical] // auto-generated
+ #endif
+ void SetUserEntryPoint(SymbolToken entryMethod);
+
+ // Open a method to emit symbol information into. The given method
+ // becomes the current method for calls do define sequence points,
+ // parameters and lexical scopes. There is an implicit lexical
+ // scope around the entire method. Re-opening a method that has
+ // been previously closed effectivley erases any previously
+ // defined symbols for that method.
+ //
+ // There can be only one open method at a time.
+ #if FEATURE_CORECLR
+ [System.Security.SecurityCritical] // auto-generated
+ #endif
+ void OpenMethod(SymbolToken method);
+
+ // Close the current method. Once a method is closed, no more
+ // symbols can be defined within it.
+ #if FEATURE_CORECLR
+ [System.Security.SecurityCritical] // auto-generated
+ #endif
+ void CloseMethod();
+
+ // Define a group of sequence points within the current method.
+ // Each line/column defines the start of a statement within a
+ // method. The arrays should be sorted by offset. The offset is
+ // always the offset from the start of the method, in bytes.
+ #if FEATURE_CORECLR
+ [System.Security.SecurityCritical] // auto-generated
+ #endif
+ void DefineSequencePoints(ISymbolDocumentWriter document,
+ int[] offsets,
+ int[] lines,
+ int[] columns,
+ int[] endLines,
+ int[] endColumns);
+
+ // Open a new lexical scope in the current method. The scope
+ // becomes the new current scope and is effectivley pushed onto a
+ // stack of scopes. startOffset is the offset, in bytes from the
+ // beginning of the method, of the first instruction in the
+ // lexical scope. Scopes must form a hierarchy. Siblings are not
+ // allowed to overlap.
+ //
+ // OpenScope returns an opaque scope id that can be used with
+ // SetScopeRange to define a scope's start/end offset at a later
+ // time. In this case, the offsets passed to OpenScope and
+ // CloseScope are ignored.
+ //
+ // Note: scope id's are only valid in the current method.
+ //
+
+ #if FEATURE_CORECLR
+ [System.Security.SecurityCritical] // auto-generated
+ #endif
+ int OpenScope(int startOffset);
+
+ // Close the current lexical scope. Once a scope is closed no more
+ // variables can be defined within it. endOffset points past the
+ // last instruction in the scope.
+ #if FEATURE_CORECLR
+ [System.Security.SecurityCritical] // auto-generated
+ #endif
+ void CloseScope(int endOffset);
+
+ // Define the offset range for a given lexical scope.
+ void SetScopeRange(int scopeID, int startOffset, int endOffset);
+
+ // Define a single variable in the current lexical
+ // scope. startOffset and endOffset are optional. If 0, then they
+ // are ignored and the variable is defined over the entire
+ // scope. If non-zero, then they must fall within the offsets of
+ // the current scope. This can be called multiple times for a
+ // variable of the same name that has multiple homes throughout a
+ // scope. (Note: start/end offsets must not overlap in such a
+ // case.)
+ #if FEATURE_CORECLR
+ [System.Security.SecurityCritical] // auto-generated
+ #endif
+ void DefineLocalVariable(String name,
+ FieldAttributes attributes,
+ byte[] signature,
+ SymAddressKind addrKind,
+ int addr1,
+ int addr2,
+ int addr3,
+ int startOffset,
+ int endOffset);
+
+ // Define a single parameter in the current method. The type of
+ // each parameter is taken from its position (sequence) within the
+ // method's signature.
+ //
+ // Note: if parameters are defined in the metadata for a given
+ // method, then clearly one would not have to define them again
+ // with calls to this method. The symbol readers will have to be
+ // smart enough to check the normal metadata for these first then
+ // fall back to the symbol store.
+ void DefineParameter(String name,
+ ParameterAttributes attributes,
+ int sequence,
+ SymAddressKind addrKind,
+ int addr1,
+ int addr2,
+ int addr3);
+
+ // Define a single variable not within a method. This is used for
+ // certian fields in classes, bitfields, etc.
+ void DefineField(SymbolToken parent,
+ String name,
+ FieldAttributes attributes,
+ byte[] signature,
+ SymAddressKind addrKind,
+ int addr1,
+ int addr2,
+ int addr3);
+
+ // Define a single global variable.
+ void DefineGlobalVariable(String name,
+ FieldAttributes attributes,
+ byte[] signature,
+ SymAddressKind addrKind,
+ int addr1,
+ int addr2,
+ int addr3);
+
+ // Close will close the ISymbolWriter and commit the symbols
+ // to the symbol store. The ISymbolWriter becomes invalid
+ // after this call for further updates.
+ void Close();
+
+ // Defines a custom attribute based upon its name. Not to be
+ // confused with Metadata custom attributes, these attributes are
+ // held in the symbol store.
+ #if FEATURE_CORECLR
+ [System.Security.SecurityCritical] // auto-generated
+ #endif
+ void SetSymAttribute(SymbolToken parent, String name, byte[] data);
+
+ // Opens a new namespace. Call this before defining methods or
+ // variables that live within a namespace. Namespaces can be nested.
+ void OpenNamespace(String name);
+
+ // Close the most recently opened namespace.
+ void CloseNamespace();
+
+ // Specifies that the given, fully qualified namespace name is
+ // being used within the currently open lexical scope. Closing the
+ // current scope will also stop using the namespace, and the
+ // namespace will be in use in all scopes that inherit from the
+ // currently open scope.
+ #if FEATURE_CORECLR
+ [System.Security.SecurityCritical] // auto-generated
+ #endif
+ void UsingNamespace(String fullName);
+
+ // Specifies the true start and end of a method within a source
+ // file. Use this to specify the extent of a method independently
+ // of what sequence points exist within the method.
+ void SetMethodSourceRange(ISymbolDocumentWriter startDoc,
+ int startLine,
+ int startColumn,
+ ISymbolDocumentWriter endDoc,
+ int endLine,
+ int endColumn);
+
+ // Used to set the underlying ISymUnmanagedWriter that a
+ // managed ISymbolWriter may use to emit symbols with.
+ void SetUnderlyingWriter(IntPtr underlyingWriter);
+ }
+
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs
new file mode 100644
index 0000000000..a7f866f2ec
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs
@@ -0,0 +1,52 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+** Represents address Kinds used with local variables, parameters, and
+** fields.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+ // Only statics, does not need to be marked with the serializable attribute
+ using System;
+
+ [Serializable]
+[System.Runtime.InteropServices.ComVisible(true)]
+ public enum SymAddressKind
+ {
+ // ILOffset: addr1 = IL local var or param index.
+ ILOffset = 1,
+
+ // NativeRVA: addr1 = RVA into module.
+ NativeRVA = 2,
+
+ // NativeRegister: addr1 = register the var is stored in.
+ NativeRegister = 3,
+
+ // NativeRegisterRelative: addr1 = register, addr2 = offset.
+ NativeRegisterRelative = 4,
+
+ // NativeOffset: addr1 = offset from start of parent.
+ NativeOffset = 5,
+
+ // NativeRegisterRegister: addr1 = reg low, addr2 = reg high.
+ NativeRegisterRegister = 6,
+
+ // NativeRegisterStack: addr1 = reg low, addr2 = reg stk, addr3 = offset.
+ NativeRegisterStack = 7,
+
+ // NativeStackRegister: addr1 = reg stk, addr2 = offset, addr3 = reg high.
+ NativeStackRegister = 8,
+
+ // BitField: addr1 = field start, addr = field length.
+ BitField = 9,
+
+ // NativeSectionOffset: addr1 = section, addr = offset
+ NativeSectionOffset = 10,
+ }
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/SymDocumentType.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/SymDocumentType.cs
new file mode 100644
index 0000000000..f7c7fea867
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/SymDocumentType.cs
@@ -0,0 +1,24 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+[System.Runtime.InteropServices.ComVisible(true)]
+** A class to hold public guids for document types to be used with the
+** symbol store.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+ // Only statics does not need to be marked with the serializable attribute
+ using System;
+
+[System.Runtime.InteropServices.ComVisible(true)]
+ public class SymDocumentType
+ {
+ public static readonly Guid Text = new Guid(0x5a869d0b, 0x6611, 0x11d3, 0xbd, 0x2a, 0x0, 0x0, 0xf8, 0x8, 0x49, 0xbd);
+ }
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/SymLanguageType.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/SymLanguageType.cs
new file mode 100644
index 0000000000..a67ba297af
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/SymLanguageType.cs
@@ -0,0 +1,42 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+[System.Runtime.InteropServices.ComVisible(true)]
+** A class to hold public guids for languages types.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+ // Only statics, does not need to be marked with the serializable attribute
+ using System;
+
+[System.Runtime.InteropServices.ComVisible(true)]
+ public class SymLanguageType
+ {
+ public static readonly Guid C = new Guid(0x63a08714, unchecked((short) 0xfc37), 0x11d2, 0x90, 0x4c, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
+ public static readonly Guid CPlusPlus = new Guid(0x3a12d0b7, unchecked((short)0xc26c), 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);
+
+ public static readonly Guid CSharp = new Guid(0x3f5162f8, unchecked((short)0x07c6), 0x11d3, 0x90, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
+
+ public static readonly Guid Basic = new Guid(0x3a12d0b8, unchecked((short)0xc26c), 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);
+
+ public static readonly Guid Java = new Guid(0x3a12d0b4, unchecked((short)0xc26c), 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);
+
+ public static readonly Guid Cobol = new Guid(unchecked((int)0xaf046cd1), unchecked((short)0xd0e1), 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
+
+ public static readonly Guid Pascal = new Guid(unchecked((int)0xaf046cd2), unchecked((short) 0xd0e1), 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
+
+ public static readonly Guid ILAssembly = new Guid(unchecked((int)0xaf046cd3), unchecked((short)0xd0e1), 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
+
+ public static readonly Guid JScript = new Guid(0x3a12d0b6, unchecked((short)0xc26c), 0x11d0, 0xb4, 0x42, 0x00, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);
+
+ public static readonly Guid SMC = new Guid(unchecked((int)0xd9b9f7b), 0x6611, unchecked((short)0x11d3), 0xbd, 0x2a, 0x0, 0x0, 0xf8, 0x8, 0x49, 0xbd);
+
+ public static readonly Guid MCPlusPlus = new Guid(0x4b35fde8, unchecked((short)0x07c6), 0x11d3, 0x90, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
+ }
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/SymLanguageVendor.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/SymLanguageVendor.cs
new file mode 100644
index 0000000000..8bef10bdad
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/SymLanguageVendor.cs
@@ -0,0 +1,23 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+[System.Runtime.InteropServices.ComVisible(true)]
+** A class to hold public guids for language vendors.
+**
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+ // Only statics, does not need to be marked with the serializable attribute
+ using System;
+
+[System.Runtime.InteropServices.ComVisible(true)]
+ public class SymLanguageVendor
+ {
+ public static readonly Guid Microsoft = new Guid(unchecked((int)0x994b45c4), unchecked((short) 0xe6e9), 0x11d2, 0x90, 0x3f, 0x00, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
+ }
+}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/Token.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/Token.cs
new file mode 100644
index 0000000000..a8a6675a2f
--- /dev/null
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/Token.cs
@@ -0,0 +1,51 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+** Small value class used by the SymbolStore package for passing
+** around metadata tokens.
+**
+===========================================================*/
+namespace System.Diagnostics.SymbolStore {
+
+ using System;
+ using System.Runtime.InteropServices;
+
+ [ComVisible(true)]
+ public struct SymbolToken
+ {
+ internal int m_token;
+
+ public SymbolToken(int val) {m_token=val;}
+
+ public int GetToken() {return m_token;}
+
+ public override int GetHashCode() {return m_token;}
+
+ public override bool Equals(Object obj)
+ {
+ if (obj is SymbolToken)
+ return Equals((SymbolToken)obj);
+ else
+ return false;
+ }
+
+ public bool Equals(SymbolToken obj)
+ {
+ return obj.m_token == m_token;
+ }
+
+ public static bool operator ==(SymbolToken a, SymbolToken b)
+ {
+ return a.Equals(b);
+ }
+
+ public static bool operator !=(SymbolToken a, SymbolToken b)
+ {
+ return !(a == b);
+ }
+ }
+}