OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with 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 | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 | 84 |
85 // This type appears only as a variable-sized list. | 85 // This type appears only as a variable-sized list. |
86 MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_DIRECTORY); | 86 MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_DIRECTORY); |
87 | 87 |
88 // These types are permitted to be oversized because their final fields are | 88 // These types are permitted to be oversized because their final fields are |
89 // variable-sized lists. | 89 // variable-sized lists. |
90 MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_MEMORY_LIST); | 90 MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_MEMORY_LIST); |
91 MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_MODULE_LIST); | 91 MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_MODULE_LIST); |
92 MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_THREAD_LIST); | 92 MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_THREAD_LIST); |
| 93 MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_MEMORY_INFO_LIST); |
93 MINIDUMP_ALLOW_OVERSIZED_DATA(MinidumpModuleCrashpadInfoList); | 94 MINIDUMP_ALLOW_OVERSIZED_DATA(MinidumpModuleCrashpadInfoList); |
94 MINIDUMP_ALLOW_OVERSIZED_DATA(MinidumpRVAList); | 95 MINIDUMP_ALLOW_OVERSIZED_DATA(MinidumpRVAList); |
95 MINIDUMP_ALLOW_OVERSIZED_DATA(MinidumpSimpleStringDictionary); | 96 MINIDUMP_ALLOW_OVERSIZED_DATA(MinidumpSimpleStringDictionary); |
96 | 97 |
97 // These types have final fields carrying variable-sized data (typically string | 98 // These types have final fields carrying variable-sized data (typically string |
98 // data). | 99 // data). |
99 MINIDUMP_ALLOW_OVERSIZED_DATA(IMAGE_DEBUG_MISC); | 100 MINIDUMP_ALLOW_OVERSIZED_DATA(IMAGE_DEBUG_MISC); |
100 MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_STRING); | 101 MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_STRING); |
101 MINIDUMP_ALLOW_OVERSIZED_DATA(CodeViewRecordPDB20); | 102 MINIDUMP_ALLOW_OVERSIZED_DATA(CodeViewRecordPDB20); |
102 MINIDUMP_ALLOW_OVERSIZED_DATA(CodeViewRecordPDB70); | 103 MINIDUMP_ALLOW_OVERSIZED_DATA(CodeViewRecordPDB70); |
(...skipping 28 matching lines...) Expand all Loading... |
131 } | 132 } |
132 | 133 |
133 //! \brief Returns a typed minidump object located within a minidump file’s | 134 //! \brief Returns a typed minidump object located within a minidump file’s |
134 //! contents, where the offset and size of the object are known. | 135 //! contents, where the offset and size of the object are known. |
135 //! | 136 //! |
136 //! This function has template specializations that perform more stringent | 137 //! This function has template specializations that perform more stringent |
137 //! checking than the default implementation: | 138 //! checking than the default implementation: |
138 //! - With a MINIDUMP_HEADER template parameter, a template specialization | 139 //! - With a MINIDUMP_HEADER template parameter, a template specialization |
139 //! ensures that the structure’s magic number and version fields are correct. | 140 //! ensures that the structure’s magic number and version fields are correct. |
140 //! - With a MINIDUMP_MEMORY_LIST, MINIDUMP_THREAD_LIST, MINIDUMP_MODULE_LIST, | 141 //! - With a MINIDUMP_MEMORY_LIST, MINIDUMP_THREAD_LIST, MINIDUMP_MODULE_LIST, |
141 //! or MinidumpSimpleStringDictionary template parameter, template | 142 //! MINIDUMP_MEMORY_INFO_LIST, or MinidumpSimpleStringDictionary template |
142 //! specializations ensure that the size given by \a location matches the | 143 //! parameter, template specializations ensure that the size given by \a |
143 //! size expected of a stream containing the number of elements it claims to | 144 //! location matches the size expected of a stream containing the number of |
144 //! have. | 145 //! elements it claims to have. |
145 //! - With an IMAGE_DEBUG_MISC, CodeViewRecordPDB20, or CodeViewRecordPDB70 | 146 //! - With an IMAGE_DEBUG_MISC, CodeViewRecordPDB20, or CodeViewRecordPDB70 |
146 //! template parameter, template specializations ensure that the structure | 147 //! template parameter, template specializations ensure that the structure |
147 //! has the expected format including any magic number and the `NUL`- | 148 //! has the expected format including any magic number and the `NUL`- |
148 //! terminated string. | 149 //! terminated string. |
149 //! | 150 //! |
150 //! \param[in] file_contents The contents of the minidump file. | 151 //! \param[in] file_contents The contents of the minidump file. |
151 //! \param[in] location A MINIDUMP_LOCATION_DESCRIPTOR giving the offset within | 152 //! \param[in] location A MINIDUMP_LOCATION_DESCRIPTOR giving the offset within |
152 //! the minidump file of the desired object, as well as its size. | 153 //! the minidump file of the desired object, as well as its size. |
153 //! | 154 //! |
154 //! \return If the size of \a location is at least as big as the size of the | 155 //! \return If the size of \a location is at least as big as the size of the |
(...skipping 28 matching lines...) Expand all Loading... |
183 const MINIDUMP_MODULE_LIST* MinidumpWritableAtLocationDescriptor< | 184 const MINIDUMP_MODULE_LIST* MinidumpWritableAtLocationDescriptor< |
184 MINIDUMP_MODULE_LIST>(const std::string& file_contents, | 185 MINIDUMP_MODULE_LIST>(const std::string& file_contents, |
185 const MINIDUMP_LOCATION_DESCRIPTOR& location); | 186 const MINIDUMP_LOCATION_DESCRIPTOR& location); |
186 | 187 |
187 template <> | 188 template <> |
188 const MINIDUMP_THREAD_LIST* MinidumpWritableAtLocationDescriptor< | 189 const MINIDUMP_THREAD_LIST* MinidumpWritableAtLocationDescriptor< |
189 MINIDUMP_THREAD_LIST>(const std::string& file_contents, | 190 MINIDUMP_THREAD_LIST>(const std::string& file_contents, |
190 const MINIDUMP_LOCATION_DESCRIPTOR& location); | 191 const MINIDUMP_LOCATION_DESCRIPTOR& location); |
191 | 192 |
192 template <> | 193 template <> |
| 194 const MINIDUMP_MEMORY_INFO_LIST* MinidumpWritableAtLocationDescriptor< |
| 195 MINIDUMP_MEMORY_INFO_LIST>(const std::string& file_contents, |
| 196 const MINIDUMP_LOCATION_DESCRIPTOR& location); |
| 197 |
| 198 template <> |
193 const CodeViewRecordPDB20* MinidumpWritableAtLocationDescriptor< | 199 const CodeViewRecordPDB20* MinidumpWritableAtLocationDescriptor< |
194 CodeViewRecordPDB20>(const std::string& file_contents, | 200 CodeViewRecordPDB20>(const std::string& file_contents, |
195 const MINIDUMP_LOCATION_DESCRIPTOR& location); | 201 const MINIDUMP_LOCATION_DESCRIPTOR& location); |
196 | 202 |
197 template <> | 203 template <> |
198 const CodeViewRecordPDB70* MinidumpWritableAtLocationDescriptor< | 204 const CodeViewRecordPDB70* MinidumpWritableAtLocationDescriptor< |
199 CodeViewRecordPDB70>(const std::string& file_contents, | 205 CodeViewRecordPDB70>(const std::string& file_contents, |
200 const MINIDUMP_LOCATION_DESCRIPTOR& location); | 206 const MINIDUMP_LOCATION_DESCRIPTOR& location); |
201 | 207 |
202 template <> | 208 template <> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 private: | 253 private: |
248 uint32_t value_; | 254 uint32_t value_; |
249 | 255 |
250 DISALLOW_COPY_AND_ASSIGN(TestUInt32MinidumpWritable); | 256 DISALLOW_COPY_AND_ASSIGN(TestUInt32MinidumpWritable); |
251 }; | 257 }; |
252 | 258 |
253 } // namespace test | 259 } // namespace test |
254 } // namespace crashpad | 260 } // namespace crashpad |
255 | 261 |
256 #endif // CRASHPAD_MINIDUMP_TEST_MINIDUMP_WRITABLE_TEST_UTIL_H_ | 262 #endif // CRASHPAD_MINIDUMP_TEST_MINIDUMP_WRITABLE_TEST_UTIL_H_ |
OLD | NEW |