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 | // =========================================================================== |
5 | // File: pdbdata.h |
6 | // |
7 | |
8 | // =========================================================================== |
9 | |
10 | #ifndef PDBDATA_H_ |
11 | #define PDBDATA_H_ |
12 | |
13 | #include "umisc.h" |
14 | #include "palclr.h" |
15 | |
16 | struct SymMethodInfo; |
17 | struct SymLexicalScope; |
18 | struct SymVariable; |
19 | struct SymUsingNamespace; |
20 | struct SymConstant; |
21 | struct SequencePoint; |
22 | struct DocumentInfo; |
23 | struct MethodInfo; |
24 | |
25 | extern "C" const GUID ILDB_VERSION_GUID_FSR; |
26 | extern "C" const GUID ILDB_VERSION_GUID; |
27 | |
28 | #define ILDB_MINOR_VERSION_NUMBER 0 |
29 | #define ILDB_SIGNATURE "_ildb_signature" |
30 | #define ILDB_SIGNATURE_SIZE (16) |
31 | |
32 | typedef struct PDBInfo { |
33 | |
34 | // Entry point of the PE |
35 | mdMethodDef m_userEntryPoint; |
36 | |
37 | UINT32 m_CountOfMethods; |
38 | UINT32 m_CountOfScopes; |
39 | UINT32 m_CountOfVars; |
40 | UINT32 m_CountOfUsing; |
41 | UINT32 m_CountOfConstants; |
42 | UINT32 m_CountOfDocuments; |
43 | UINT32 m_CountOfSequencePoints; |
44 | UINT32 m_CountOfBytes; |
45 | UINT32 m_CountOfStringBytes; |
46 | |
47 | public: |
48 | PDBInfo() |
49 | { |
50 | memset(this, 0, sizeof(PDBInfo)); |
51 | // Make sure m_userEntryPoint initialized correctly |
52 | _ASSERTE(mdTokenNil == 0); |
53 | } |
54 | |
55 | #if BIGENDIAN |
56 | void ConvertEndianness() { |
57 | m_userEntryPoint = VAL32(m_userEntryPoint); |
58 | m_CountOfMethods = VAL32(m_CountOfMethods); |
59 | m_CountOfScopes = VAL32(m_CountOfScopes); |
60 | m_CountOfVars = VAL32(m_CountOfVars); |
61 | m_CountOfUsing = VAL32(m_CountOfUsing); |
62 | m_CountOfConstants = VAL32(m_CountOfConstants); |
63 | m_CountOfSequencePoints = VAL32(m_CountOfSequencePoints); |
64 | m_CountOfDocuments = VAL32(m_CountOfDocuments); |
65 | m_CountOfBytes = VAL32(m_CountOfBytes); |
66 | m_CountOfStringBytes = VAL32(m_CountOfStringBytes); |
67 | } |
68 | #else |
69 | void ConvertEndianness() {} |
70 | #endif |
71 | |
72 | } PDBInfo; |
73 | |
74 | // The signature, Guid version + PDBInfo data |
75 | #define (ILDB_SIGNATURE_SIZE + sizeof(GUID) + sizeof(PDBInfo) ) |
76 | |
77 | typedef struct PDBDataPointers |
78 | { |
79 | SymMethodInfo * m_pMethods; // Method information |
80 | SymLexicalScope *m_pScopes; // Scopes |
81 | SymVariable *m_pVars; // Local Variables |
82 | SymUsingNamespace *m_pUsings; // list of using/imports |
83 | SymConstant *m_pConstants; // Constants |
84 | DocumentInfo *m_pDocuments; // Documents |
85 | SequencePoint *m_pSequencePoints; // Sequence Points |
86 | // Array of various bytes (variable signature, etc) |
87 | BYTE *m_pBytes; |
88 | // Strings |
89 | BYTE *m_pStringsBytes; |
90 | } PDBDataPointers; |
91 | |
92 | #endif /* PDBDATA_H_ */ |
93 | |