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
16struct SymMethodInfo;
17struct SymLexicalScope;
18struct SymVariable;
19struct SymUsingNamespace;
20struct SymConstant;
21struct SequencePoint;
22struct DocumentInfo;
23struct MethodInfo;
24
25extern "C" const GUID ILDB_VERSION_GUID_FSR;
26extern "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
32typedef 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
47public:
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_HEADER_SIZE (ILDB_SIGNATURE_SIZE + sizeof(GUID) + sizeof(PDBInfo) )
76
77typedef 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