Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: minidump/minidump_extensions.h

Issue 1311003003: Implement ModuleSnapshotWin::UUID (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: fixes Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « compat/non_win/dbghelp.h ('k') | minidump/minidump_extensions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and 12 // See the License for the specific language governing permissions and
13 // limitations under the License. 13 // limitations under the License.
14 14
15 #ifndef CRASHPAD_MINIDUMP_MINIDUMP_EXTENSIONS_H_ 15 #ifndef CRASHPAD_MINIDUMP_MINIDUMP_EXTENSIONS_H_
16 #define CRASHPAD_MINIDUMP_MINIDUMP_EXTENSIONS_H_ 16 #define CRASHPAD_MINIDUMP_MINIDUMP_EXTENSIONS_H_
17 17
18 #include <windows.h> 18 #include <windows.h>
19 #include <dbghelp.h> 19 #include <dbghelp.h>
20 #include <stdint.h> 20 #include <stdint.h>
21 #include <winnt.h> 21 #include <winnt.h>
22 22
23 #include "base/compiler_specific.h" 23 #include "base/compiler_specific.h"
24 #include "build/build_config.h" 24 #include "build/build_config.h"
25 #include "util/misc/pdb_structures.h"
25 #include "util/misc/uuid.h" 26 #include "util/misc/uuid.h"
26 27
27 // C4200 is "nonstandard extension used : zero-sized array in struct/union". 28 // C4200 is "nonstandard extension used : zero-sized array in struct/union".
28 // We would like to globally disable this warning, but unfortunately, the 29 // We would like to globally disable this warning, but unfortunately, the
29 // compiler is buggy and only supports disabling it with a pragma, so we can't 30 // compiler is buggy and only supports disabling it with a pragma, so we can't
30 // disable it with other silly warnings in build/common.gypi. See: 31 // disable it with other silly warnings in build/common.gypi. See:
31 // https://connect.microsoft.com/VisualStudio/feedback/details/1114440 32 // https://connect.microsoft.com/VisualStudio/feedback/details/1114440
32 MSVC_PUSH_DISABLE_WARNING(4200); 33 MSVC_PUSH_DISABLE_WARNING(4200);
33 34
34 #if defined(COMPILER_MSVC) 35 #if defined(COMPILER_MSVC)
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 210
210 kMinidumpOSPS3 = 0x8204, 211 kMinidumpOSPS3 = 0x8204,
211 212
212 //! \brief Native Client (NaCl). 213 //! \brief Native Client (NaCl).
213 kMinidumpOSNaCl = 0x8205, 214 kMinidumpOSNaCl = 0x8205,
214 215
215 //! \brief Unknown operating system. 216 //! \brief Unknown operating system.
216 kMinidumpOSUnknown = 0xffffffff, 217 kMinidumpOSUnknown = 0xffffffff,
217 }; 218 };
218 219
219 //! \brief A CodeView record linking to a `.pdb` 2.0 file.
220 //!
221 //! This format provides an indirect link to debugging data by referencing an
222 //! external `.pdb` file by its name, timestamp, and age. This structure may be
223 //! pointed to by MINIDUMP_MODULE::CvRecord. It has been superseded by
224 //! MinidumpModuleCodeViewRecordPDB70.
225 //!
226 //! For more information about this structure and format, see <a
227 //! href="http://www.debuginfo.com/articles/debuginfomatch.html#pdbfiles">Matchi ng
228 //! Debug Information</a>, PDB Files, and <a
229 //! href="http://undocumented.rawol.com/sbs-w2k-1-windows-2000-debugging-support .pdf#page=63">Undocumented
230 //! Windows 2000 Secrets</a>, Windows 2000 Debugging Support/Microsoft Symbol
231 //! File Internals/CodeView Subsections.
232 //!
233 //! \sa IMAGE_DEBUG_MISC
234 struct MinidumpModuleCodeViewRecordPDB20 {
235 //! \brief The magic number identifying this structure version, stored in
236 //! #signature.
237 //!
238 //! In a hex dump, this will appear as “NB10” when produced by a little-endian
239 //! machine.
240 static const uint32_t kSignature = '01BN';
241
242 //! \brief The magic number identifying this structure version, the value of
243 //! #kSignature.
244 uint32_t signature;
245
246 //! \brief The offset to CodeView data.
247 //!
248 //! In this structure, this field always has the value `0` because no CodeView
249 //! data is present, there is only a link to CodeView data stored in an
250 //! external file.
251 uint32_t offset;
252
253 //! \brief The time that the `.pdb` file was created, in `time_t` format, the
254 //! number of seconds since the POSIX epoch.
255 uint32_t timestamp;
256
257 //! \brief The revision of the `.pdb` file.
258 //!
259 //! A `.pdb` file’s age indicates incremental changes to it. When a `.pdb`
260 //! file is created, it has age `1`, and subsequent updates increase this
261 //! value.
262 uint32_t age;
263
264 //! \brief The path or file name of the `.pdb` file associated with the
265 //! module.
266 //!
267 //! This is a NUL-terminated string. On Windows, it will be encoded in the
268 //! code page of the system that linked the module. On other operating
269 //! systems, UTF-8 may be used.
270 uint8_t pdb_name[1];
271 };
272
273 //! \brief A CodeView record linking to a `.pdb` 7.0 file.
274 //!
275 //! This format provides an indirect link to debugging data by referencing an
276 //! external `.pdb` file by its name, %UUID, and age. This structure may be
277 //! pointed to by MINIDUMP_MODULE::CvRecord.
278 //!
279 //! For more information about this structure and format, see <a
280 //! href="http://www.debuginfo.com/articles/debuginfomatch.html#pdbfiles">Matchi ng
281 //! Debug Information</a>, PDB Files.
282 //!
283 //! \sa MinidumpModuleCodeViewRecordPDB20
284 //! \sa IMAGE_DEBUG_MISC
285 struct MinidumpModuleCodeViewRecordPDB70 {
286 // UUID has a constructor, which makes it non-POD, which makes this structure
287 // non-POD. In order for the default constructor to zero-initialize other
288 // members, an explicit constructor must be provided.
289 MinidumpModuleCodeViewRecordPDB70()
290 : signature(),
291 uuid(),
292 age(),
293 pdb_name() {
294 }
295
296 //! \brief The magic number identifying this structure version, stored in
297 //! #signature.
298 //!
299 //! In a hex dump, this will appear as “RSDS” when produced by a little-endian
300 //! machine.
301 static const uint32_t kSignature = 'SDSR';
302
303 //! \brief The magic number identifying this structure version, the value of
304 //! #kSignature.
305 uint32_t signature;
306
307 //! \brief The `.pdb` file’s unique identifier.
308 UUID uuid;
309
310 //! \brief The revision of the `.pdb` file.
311 //!
312 //! A `.pdb` file’s age indicates incremental changes to it. When a `.pdb`
313 //! file is created, it has age `1`, and subsequent updates increase this
314 //! value.
315 uint32_t age;
316
317 //! \brief The path or file name of the `.pdb` file associated with the
318 //! module.
319 //!
320 //! This is a NUL-terminated string. On Windows, it will be encoded in the
321 //! code page of the system that linked the module. On other operating
322 //! systems, UTF-8 may be used.
323 uint8_t pdb_name[1];
324 };
325 220
326 //! \brief A list of ::RVA pointers. 221 //! \brief A list of ::RVA pointers.
327 struct ALIGNAS(4) PACKED MinidumpRVAList { 222 struct ALIGNAS(4) PACKED MinidumpRVAList {
328 //! \brief The number of children present in the #children array. 223 //! \brief The number of children present in the #children array.
329 uint32_t count; 224 uint32_t count;
330 225
331 //! \brief Pointers to other structures in the minidump file. 226 //! \brief Pointers to other structures in the minidump file.
332 RVA children[0]; 227 RVA children[0];
333 }; 228 };
334 229
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 #if defined(COMPILER_MSVC) 417 #if defined(COMPILER_MSVC)
523 #pragma pack(pop) 418 #pragma pack(pop)
524 #endif // COMPILER_MSVC 419 #endif // COMPILER_MSVC
525 #undef PACKED 420 #undef PACKED
526 421
527 MSVC_POP_WARNING(); // C4200 422 MSVC_POP_WARNING(); // C4200
528 423
529 } // namespace crashpad 424 } // namespace crashpad
530 425
531 #endif // CRASHPAD_MINIDUMP_MINIDUMP_EXTENSIONS_H_ 426 #endif // CRASHPAD_MINIDUMP_MINIDUMP_EXTENSIONS_H_
OLDNEW
« no previous file with comments | « compat/non_win/dbghelp.h ('k') | minidump/minidump_extensions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698