OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
| 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at |
| 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. |
| 14 |
| 15 #ifndef CRASHPAD_UTIL_MISC_PDB_STRUCTURES_H_ |
| 16 #define CRASHPAD_UTIL_MISC_PDB_STRUCTURES_H_ |
| 17 |
| 18 #include "util/misc/uuid.h" |
| 19 |
| 20 namespace crashpad { |
| 21 |
| 22 //! \brief A CodeView record linking to a `.pdb` 2.0 file. |
| 23 //! |
| 24 //! This format provides an indirect link to debugging data by referencing an |
| 25 //! external `.pdb` file by its name, timestamp, and age. This structure may be |
| 26 //! pointed to by MINIDUMP_MODULE::CvRecord. It has been superseded by |
| 27 //! CodeViewRecordPDB70. |
| 28 //! |
| 29 //! For more information about this structure and format, see <a |
| 30 //! href="http://www.debuginfo.com/articles/debuginfomatch.html#pdbfiles">Matchi
ng |
| 31 //! Debug Information</a>, PDB Files, and <a |
| 32 //! href="http://undocumented.rawol.com/sbs-w2k-1-windows-2000-debugging-support
.pdf#page=63">Undocumented |
| 33 //! Windows 2000 Secrets</a>, Windows 2000 Debugging Support/Microsoft Symbol |
| 34 //! File Internals/CodeView Subsections. |
| 35 //! |
| 36 //! \sa IMAGE_DEBUG_MISC |
| 37 struct CodeViewRecordPDB20 { |
| 38 //! \brief The magic number identifying this structure version, stored in |
| 39 //! #signature. |
| 40 //! |
| 41 //! In a hex dump, this will appear as “NB10” when produced by a little-endian |
| 42 //! machine. |
| 43 static const uint32_t kSignature = '01BN'; |
| 44 |
| 45 //! \brief The magic number identifying this structure version, the value of |
| 46 //! #kSignature. |
| 47 uint32_t signature; |
| 48 |
| 49 //! \brief The offset to CodeView data. |
| 50 //! |
| 51 //! In this structure, this field always has the value `0` because no CodeView |
| 52 //! data is present, there is only a link to CodeView data stored in an |
| 53 //! external file. |
| 54 uint32_t offset; |
| 55 |
| 56 //! \brief The time that the `.pdb` file was created, in `time_t` format, the |
| 57 //! number of seconds since the POSIX epoch. |
| 58 uint32_t timestamp; |
| 59 |
| 60 //! \brief The revision of the `.pdb` file. |
| 61 //! |
| 62 //! A `.pdb` file’s age indicates incremental changes to it. When a `.pdb` |
| 63 //! file is created, it has age `1`, and subsequent updates increase this |
| 64 //! value. |
| 65 uint32_t age; |
| 66 |
| 67 //! \brief The path or file name of the `.pdb` file associated with the |
| 68 //! module. |
| 69 //! |
| 70 //! This is a NUL-terminated string. On Windows, it will be encoded in the |
| 71 //! code page of the system that linked the module. On other operating |
| 72 //! systems, UTF-8 may be used. |
| 73 uint8_t pdb_name[1]; |
| 74 }; |
| 75 |
| 76 //! \brief A CodeView record linking to a `.pdb` 7.0 file. |
| 77 //! |
| 78 //! This format provides an indirect link to debugging data by referencing an |
| 79 //! external `.pdb` file by its name, %UUID, and age. This structure may be |
| 80 //! pointed to by MINIDUMP_MODULE::CvRecord. |
| 81 //! |
| 82 //! For more information about this structure and format, see <a |
| 83 //! href="http://www.debuginfo.com/articles/debuginfomatch.html#pdbfiles">Matchi
ng |
| 84 //! Debug Information</a>, PDB Files. |
| 85 //! |
| 86 //! \sa CodeViewRecordPDB20 |
| 87 //! \sa IMAGE_DEBUG_MISC |
| 88 struct CodeViewRecordPDB70 { |
| 89 // UUID has a constructor, which makes it non-POD, which makes this structure |
| 90 // non-POD. In order for the default constructor to zero-initialize other |
| 91 // members, an explicit constructor must be provided. |
| 92 CodeViewRecordPDB70() |
| 93 : signature(), |
| 94 uuid(), |
| 95 age(), |
| 96 pdb_name() { |
| 97 } |
| 98 |
| 99 //! \brief The magic number identifying this structure version, stored in |
| 100 //! #signature. |
| 101 //! |
| 102 //! In a hex dump, this will appear as “RSDS” when produced by a little-endian |
| 103 //! machine. |
| 104 static const uint32_t kSignature = 'SDSR'; |
| 105 |
| 106 //! \brief The magic number identifying this structure version, the value of |
| 107 //! #kSignature. |
| 108 uint32_t signature; |
| 109 |
| 110 //! \brief The `.pdb` file’s unique identifier. |
| 111 UUID uuid; |
| 112 |
| 113 //! \brief The revision of the `.pdb` file. |
| 114 //! |
| 115 //! A `.pdb` file’s age indicates incremental changes to it. When a `.pdb` |
| 116 //! file is created, it has age `1`, and subsequent updates increase this |
| 117 //! value. |
| 118 uint32_t age; |
| 119 |
| 120 //! \brief The path or file name of the `.pdb` file associated with the |
| 121 //! module. |
| 122 //! |
| 123 //! This is a NUL-terminated string. On Windows, it will be encoded in the |
| 124 //! code page of the system that linked the module. On other operating |
| 125 //! systems, UTF-8 may be used. |
| 126 uint8_t pdb_name[1]; |
| 127 }; |
| 128 |
| 129 } // namespace crashpad |
| 130 |
| 131 #endif // CRASHPAD_UTIL_MISC_PDB_STRUCTURES_H_ |
OLD | NEW |