You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This contract is for getting information from the streams embedded into a dump file as it crashes
4
+
5
+
## APIs of contract
6
+
7
+
```csharp
8
+
// Return string corresponding to type system data structure if it exists, or null otherwise
9
+
stringStringFromEEAddress(TargetPointeraddress);
10
+
```
11
+
12
+
## Version 1
13
+
14
+
Global variables used
15
+
| Global Name | Type | Purpose |
16
+
| --- | --- | --- |
17
+
| MiniMetaDataBuffAddress | TargetPointer | Identify where the mini metadata stream exists |
18
+
| MiniMetaDataBuffMaxSize | uint | Identify where the size of the mini metadata stream |
19
+
20
+
Magic numbers
21
+
| Name | Value |
22
+
| --- | --- |
23
+
| MiniMetadataSignature | 0x6d727473 |
24
+
| EENameStreamSignature | 0x614e4545 |
25
+
26
+
The format of the MiniMetadataStream begins with a Streams header, which has 3 fields
27
+
28
+
| Field | Type | Offset | Meaning |
29
+
| --- | --- | --- | --- |
30
+
| MiniMetadataSignature| uint | 0 | Magic value used to identify that there are streams |
31
+
| TotalSize | uint | 4 | Total size of the entire set of MiniMetadata streams including this header |
32
+
| Count of Streams | uint | 8 | Number of streams in the MiniMetadata |
33
+
34
+
The concept is that each stream simply follows the previous stream in the buffer.
35
+
There is no padding, so the data is not expected to be aligned within the buffer.
36
+
NOTE: At the moment there is only 1 supported stream type, so Count of Streams can only be 1.
37
+
38
+
The `EENameStream` is structured as a header, plus a series of null-terminated utf8 strings, and pointers.
39
+
40
+
The EENameStream header
41
+
| Field | Type | Offset | Meaning |
42
+
| --- | --- | --- | --- |
43
+
| EENameStreamSignature | uint | 0 | Magic value used to identify that the bytes immediately following are an `EENameStream`|
44
+
| CountOfNames | uint | 4 | Number of names encoded |
45
+
46
+
EENameStream entry
47
+
| Field | Type | Offset | Meaning |
48
+
| --- | --- | --- | --- |
49
+
| Pointer | pointer | 0 | Pointer to type system structure |
50
+
| String | null-terminated UTF-8 sting | 4 or 8 based on target pointer size | Pointer to type system structure |
51
+
52
+
Following the EENameStream header, there are CountOfNames entries. Each entry begins with a target pointer sized block which identifies a particular type system data structure, followed by a utf8 encoded null-terminated string.
// Parse MiniMetadataStream according the the format described above to produce a dictionary from pointer to string from the EENameStream.
61
+
// Then lookup in the dictionary, to produce a result if it was present in the table.
62
+
// In general, since this api is intended for fallback scenarios, implementations of this api should attempt
63
+
// to return null instead of producing errors.
64
+
// Since in normal execution of the runtime no stream is constructed, it is normal when examining full dumps and live process state without a stream encoded.
0 commit comments