OLD | NEW |
1 /* Copyright (c) 2006, Google Inc. | 1 /* Copyright (c) 2006, Google Inc. |
2 * All rights reserved. | 2 * All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 #pragma warning(push) | 72 #pragma warning(push) |
73 #pragma warning(disable:4200) | 73 #pragma warning(disable:4200) |
74 #endif /* _MSC_VER */ | 74 #endif /* _MSC_VER */ |
75 | 75 |
76 | 76 |
77 /* | 77 /* |
78 * guiddef.h | 78 * guiddef.h |
79 */ | 79 */ |
80 | 80 |
81 typedef struct { | 81 typedef struct { |
82 u_int32_t data1; | 82 uint32_t data1; |
83 u_int16_t data2; | 83 uint16_t data2; |
84 u_int16_t data3; | 84 uint16_t data3; |
85 u_int8_t data4[8]; | 85 uint8_t data4[8]; |
86 } MDGUID; /* GUID */ | 86 } MDGUID; /* GUID */ |
87 | 87 |
88 | 88 |
89 /* | 89 /* |
90 * WinNT.h | 90 * WinNT.h |
91 */ | 91 */ |
92 | 92 |
93 /* Non-x86 CPU identifiers found in the high 24 bits of | 93 /* Non-x86 CPU identifiers found in the high 24 bits of |
94 * (MDRawContext*).context_flags. These aren't used by Breakpad, but are | 94 * (MDRawContext*).context_flags. These aren't used by Breakpad, but are |
95 * defined here for reference, to avoid assigning values that conflict | 95 * defined here for reference, to avoid assigning values that conflict |
96 * (although some values already conflict). */ | 96 * (although some values already conflict). */ |
97 #define MD_CONTEXT_IA64 0x00080000 /* CONTEXT_IA64 */ | 97 #define MD_CONTEXT_IA64 0x00080000 /* CONTEXT_IA64 */ |
98 /* Additional values from winnt.h in the Windows CE 5.0 SDK: */ | 98 /* Additional values from winnt.h in the Windows CE 5.0 SDK: */ |
99 #define MD_CONTEXT_SHX 0x000000c0 /* CONTEXT_SH4 (Super-H, includes SH3) */ | 99 #define MD_CONTEXT_SHX 0x000000c0 /* CONTEXT_SH4 (Super-H, includes SH3) */ |
100 #define MD_CONTEXT_MIPS 0x00010000 /* CONTEXT_R4000 (same value as x86?) */ | 100 #define MD_CONTEXT_MIPS 0x00010000 /* CONTEXT_R4000 (same value as x86?) */ |
101 #define MD_CONTEXT_ALPHA 0x00020000 /* CONTEXT_ALPHA */ | 101 #define MD_CONTEXT_ALPHA 0x00020000 /* CONTEXT_ALPHA */ |
102 | 102 |
103 /* As of Windows 7 SP1, the number of flag bits has increased to | 103 /* As of Windows 7 SP1, the number of flag bits has increased to |
104 * include 0x40 (CONTEXT_XSTATE): | 104 * include 0x40 (CONTEXT_XSTATE): |
105 * http://msdn.microsoft.com/en-us/library/hh134238%28v=vs.85%29.aspx */ | 105 * http://msdn.microsoft.com/en-us/library/hh134238%28v=vs.85%29.aspx */ |
106 #define MD_CONTEXT_CPU_MASK 0xffffff00 | 106 #define MD_CONTEXT_CPU_MASK 0xffffff00 |
107 | 107 |
108 | 108 |
109 /* This is a base type for MDRawContextX86 and MDRawContextPPC. This | 109 /* This is a base type for MDRawContextX86 and MDRawContextPPC. This |
110 * structure should never be allocated directly. The actual structure type | 110 * structure should never be allocated directly. The actual structure type |
111 * can be determined by examining the context_flags field. */ | 111 * can be determined by examining the context_flags field. */ |
112 typedef struct { | 112 typedef struct { |
113 u_int32_t context_flags; | 113 uint32_t context_flags; |
114 } MDRawContextBase; | 114 } MDRawContextBase; |
115 | 115 |
116 #include "minidump_cpu_amd64.h" | 116 #include "minidump_cpu_amd64.h" |
117 #include "minidump_cpu_arm.h" | 117 #include "minidump_cpu_arm.h" |
118 #include "minidump_cpu_ppc.h" | 118 #include "minidump_cpu_ppc.h" |
119 #include "minidump_cpu_ppc64.h" | 119 #include "minidump_cpu_ppc64.h" |
120 #include "minidump_cpu_sparc.h" | 120 #include "minidump_cpu_sparc.h" |
121 #include "minidump_cpu_x86.h" | 121 #include "minidump_cpu_x86.h" |
122 | 122 |
123 /* | 123 /* |
124 * WinVer.h | 124 * WinVer.h |
125 */ | 125 */ |
126 | 126 |
127 | 127 |
128 typedef struct { | 128 typedef struct { |
129 u_int32_t signature; | 129 uint32_t signature; |
130 u_int32_t struct_version; | 130 uint32_t struct_version; |
131 u_int32_t file_version_hi; | 131 uint32_t file_version_hi; |
132 u_int32_t file_version_lo; | 132 uint32_t file_version_lo; |
133 u_int32_t product_version_hi; | 133 uint32_t product_version_hi; |
134 u_int32_t product_version_lo; | 134 uint32_t product_version_lo; |
135 u_int32_t file_flags_mask; /* Identifies valid bits in fileFlags */ | 135 uint32_t file_flags_mask; /* Identifies valid bits in fileFlags */ |
136 u_int32_t file_flags; | 136 uint32_t file_flags; |
137 u_int32_t file_os; | 137 uint32_t file_os; |
138 u_int32_t file_type; | 138 uint32_t file_type; |
139 u_int32_t file_subtype; | 139 uint32_t file_subtype; |
140 u_int32_t file_date_hi; | 140 uint32_t file_date_hi; |
141 u_int32_t file_date_lo; | 141 uint32_t file_date_lo; |
142 } MDVSFixedFileInfo; /* VS_FIXEDFILEINFO */ | 142 } MDVSFixedFileInfo; /* VS_FIXEDFILEINFO */ |
143 | 143 |
144 /* For (MDVSFixedFileInfo).signature */ | 144 /* For (MDVSFixedFileInfo).signature */ |
145 #define MD_VSFIXEDFILEINFO_SIGNATURE 0xfeef04bd | 145 #define MD_VSFIXEDFILEINFO_SIGNATURE 0xfeef04bd |
146 /* VS_FFI_SIGNATURE */ | 146 /* VS_FFI_SIGNATURE */ |
147 | 147 |
148 /* For (MDVSFixedFileInfo).version */ | 148 /* For (MDVSFixedFileInfo).version */ |
149 #define MD_VSFIXEDFILEINFO_VERSION 0x00010000 | 149 #define MD_VSFIXEDFILEINFO_VERSION 0x00010000 |
150 /* VS_FFI_STRUCVERSION */ | 150 /* VS_FFI_STRUCVERSION */ |
151 | 151 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 /* VFT2_FONT_TRUETYPE */ | 224 /* VFT2_FONT_TRUETYPE */ |
225 | 225 |
226 | 226 |
227 /* | 227 /* |
228 * DbgHelp.h | 228 * DbgHelp.h |
229 */ | 229 */ |
230 | 230 |
231 | 231 |
232 /* An MDRVA is an offset into the minidump file. The beginning of the | 232 /* An MDRVA is an offset into the minidump file. The beginning of the |
233 * MDRawHeader is at offset 0. */ | 233 * MDRawHeader is at offset 0. */ |
234 typedef u_int32_t MDRVA; /* RVA */ | 234 typedef uint32_t MDRVA; /* RVA */ |
235 | 235 |
236 typedef struct { | 236 typedef struct { |
237 u_int32_t data_size; | 237 uint32_t data_size; |
238 MDRVA rva; | 238 MDRVA rva; |
239 } MDLocationDescriptor; /* MINIDUMP_LOCATION_DESCRIPTOR */ | 239 } MDLocationDescriptor; /* MINIDUMP_LOCATION_DESCRIPTOR */ |
240 | 240 |
241 | 241 |
242 typedef struct { | 242 typedef struct { |
243 /* The base address of the memory range on the host that produced the | 243 /* The base address of the memory range on the host that produced the |
244 * minidump. */ | 244 * minidump. */ |
245 u_int64_t start_of_memory_range; | 245 uint64_t start_of_memory_range; |
246 | 246 |
247 MDLocationDescriptor memory; | 247 MDLocationDescriptor memory; |
248 } MDMemoryDescriptor; /* MINIDUMP_MEMORY_DESCRIPTOR */ | 248 } MDMemoryDescriptor; /* MINIDUMP_MEMORY_DESCRIPTOR */ |
249 | 249 |
250 | 250 |
251 typedef struct { | 251 typedef struct { |
252 u_int32_t signature; | 252 uint32_t signature; |
253 u_int32_t version; | 253 uint32_t version; |
254 u_int32_t stream_count; | 254 uint32_t stream_count; |
255 MDRVA stream_directory_rva; /* A |stream_count|-sized array of | 255 MDRVA stream_directory_rva; /* A |stream_count|-sized array of |
256 * MDRawDirectory structures. */ | 256 * MDRawDirectory structures. */ |
257 u_int32_t checksum; /* Can be 0. In fact, that's all that's | 257 uint32_t checksum; /* Can be 0. In fact, that's all that's |
258 * been found in minidump files. */ | 258 * been found in minidump files. */ |
259 u_int32_t time_date_stamp; /* time_t */ | 259 uint32_t time_date_stamp; /* time_t */ |
260 u_int64_t flags; | 260 uint64_t flags; |
261 } MDRawHeader; /* MINIDUMP_HEADER */ | 261 } MDRawHeader; /* MINIDUMP_HEADER */ |
262 | 262 |
263 /* For (MDRawHeader).signature and (MDRawHeader).version. Note that only the | 263 /* For (MDRawHeader).signature and (MDRawHeader).version. Note that only the |
264 * low 16 bits of (MDRawHeader).version are MD_HEADER_VERSION. Per the | 264 * low 16 bits of (MDRawHeader).version are MD_HEADER_VERSION. Per the |
265 * documentation, the high 16 bits are implementation-specific. */ | 265 * documentation, the high 16 bits are implementation-specific. */ |
266 #define MD_HEADER_SIGNATURE 0x504d444d /* 'PMDM' */ | 266 #define MD_HEADER_SIGNATURE 0x504d444d /* 'PMDM' */ |
267 /* MINIDUMP_SIGNATURE */ | 267 /* MINIDUMP_SIGNATURE */ |
268 #define MD_HEADER_VERSION 0x0000a793 /* 42899 */ | 268 #define MD_HEADER_VERSION 0x0000a793 /* 42899 */ |
269 /* MINIDUMP_VERSION */ | 269 /* MINIDUMP_VERSION */ |
270 | 270 |
(...skipping 24 matching lines...) Expand all Loading... |
295 MD_WITH_CODE_SEGS = 0x00002000, | 295 MD_WITH_CODE_SEGS = 0x00002000, |
296 MD_WITHOUT_AUXILLIARY_SEGS = 0x00004000, | 296 MD_WITHOUT_AUXILLIARY_SEGS = 0x00004000, |
297 MD_WITH_FULL_AUXILLIARY_STATE = 0x00008000, | 297 MD_WITH_FULL_AUXILLIARY_STATE = 0x00008000, |
298 MD_WITH_PRIVATE_WRITE_COPY_MEMORY = 0x00010000, | 298 MD_WITH_PRIVATE_WRITE_COPY_MEMORY = 0x00010000, |
299 MD_IGNORE_INACCESSIBLE_MEMORY = 0x00020000, | 299 MD_IGNORE_INACCESSIBLE_MEMORY = 0x00020000, |
300 MD_WITH_TOKEN_INFORMATION = 0x00040000 | 300 MD_WITH_TOKEN_INFORMATION = 0x00040000 |
301 } MDType; /* MINIDUMP_TYPE */ | 301 } MDType; /* MINIDUMP_TYPE */ |
302 | 302 |
303 | 303 |
304 typedef struct { | 304 typedef struct { |
305 u_int32_t stream_type; | 305 uint32_t stream_type; |
306 MDLocationDescriptor location; | 306 MDLocationDescriptor location; |
307 } MDRawDirectory; /* MINIDUMP_DIRECTORY */ | 307 } MDRawDirectory; /* MINIDUMP_DIRECTORY */ |
308 | 308 |
309 /* For (MDRawDirectory).stream_type */ | 309 /* For (MDRawDirectory).stream_type */ |
310 typedef enum { | 310 typedef enum { |
311 MD_UNUSED_STREAM = 0, | 311 MD_UNUSED_STREAM = 0, |
312 MD_RESERVED_STREAM_0 = 1, | 312 MD_RESERVED_STREAM_0 = 1, |
313 MD_RESERVED_STREAM_1 = 2, | 313 MD_RESERVED_STREAM_1 = 2, |
314 MD_THREAD_LIST_STREAM = 3, /* MDRawThreadList */ | 314 MD_THREAD_LIST_STREAM = 3, /* MDRawThreadList */ |
315 MD_MODULE_LIST_STREAM = 4, /* MDRawModuleList */ | 315 MD_MODULE_LIST_STREAM = 4, /* MDRawModuleList */ |
(...skipping 23 matching lines...) Expand all Loading... |
339 MD_LINUX_LSB_RELEASE = 0x47670005, /* /etc/lsb-release */ | 339 MD_LINUX_LSB_RELEASE = 0x47670005, /* /etc/lsb-release */ |
340 MD_LINUX_CMD_LINE = 0x47670006, /* /proc/$x/cmdline */ | 340 MD_LINUX_CMD_LINE = 0x47670006, /* /proc/$x/cmdline */ |
341 MD_LINUX_ENVIRON = 0x47670007, /* /proc/$x/environ */ | 341 MD_LINUX_ENVIRON = 0x47670007, /* /proc/$x/environ */ |
342 MD_LINUX_AUXV = 0x47670008, /* /proc/$x/auxv */ | 342 MD_LINUX_AUXV = 0x47670008, /* /proc/$x/auxv */ |
343 MD_LINUX_MAPS = 0x47670009, /* /proc/$x/maps */ | 343 MD_LINUX_MAPS = 0x47670009, /* /proc/$x/maps */ |
344 MD_LINUX_DSO_DEBUG = 0x4767000A /* MDRawDebug */ | 344 MD_LINUX_DSO_DEBUG = 0x4767000A /* MDRawDebug */ |
345 } MDStreamType; /* MINIDUMP_STREAM_TYPE */ | 345 } MDStreamType; /* MINIDUMP_STREAM_TYPE */ |
346 | 346 |
347 | 347 |
348 typedef struct { | 348 typedef struct { |
349 u_int32_t length; /* Length of buffer in bytes (not characters), | 349 uint32_t length; /* Length of buffer in bytes (not characters), |
350 * excluding 0-terminator */ | 350 * excluding 0-terminator */ |
351 u_int16_t buffer[1]; /* UTF-16-encoded, 0-terminated */ | 351 uint16_t buffer[1]; /* UTF-16-encoded, 0-terminated */ |
352 } MDString; /* MINIDUMP_STRING */ | 352 } MDString; /* MINIDUMP_STRING */ |
353 | 353 |
354 static const size_t MDString_minsize = offsetof(MDString, buffer[0]); | 354 static const size_t MDString_minsize = offsetof(MDString, buffer[0]); |
355 | 355 |
356 | 356 |
357 typedef struct { | 357 typedef struct { |
358 u_int32_t thread_id; | 358 uint32_t thread_id; |
359 u_int32_t suspend_count; | 359 uint32_t suspend_count; |
360 u_int32_t priority_class; | 360 uint32_t priority_class; |
361 u_int32_t priority; | 361 uint32_t priority; |
362 u_int64_t teb; /* Thread environment block */ | 362 uint64_t teb; /* Thread environment block */ |
363 MDMemoryDescriptor stack; | 363 MDMemoryDescriptor stack; |
364 MDLocationDescriptor thread_context; /* MDRawContext[CPU] */ | 364 MDLocationDescriptor thread_context; /* MDRawContext[CPU] */ |
365 } MDRawThread; /* MINIDUMP_THREAD */ | 365 } MDRawThread; /* MINIDUMP_THREAD */ |
366 | 366 |
367 | 367 |
368 typedef struct { | 368 typedef struct { |
369 u_int32_t number_of_threads; | 369 uint32_t number_of_threads; |
370 MDRawThread threads[1]; | 370 MDRawThread threads[1]; |
371 } MDRawThreadList; /* MINIDUMP_THREAD_LIST */ | 371 } MDRawThreadList; /* MINIDUMP_THREAD_LIST */ |
372 | 372 |
373 static const size_t MDRawThreadList_minsize = offsetof(MDRawThreadList, | 373 static const size_t MDRawThreadList_minsize = offsetof(MDRawThreadList, |
374 threads[0]); | 374 threads[0]); |
375 | 375 |
376 | 376 |
377 typedef struct { | 377 typedef struct { |
378 u_int64_t base_of_image; | 378 uint64_t base_of_image; |
379 u_int32_t size_of_image; | 379 uint32_t size_of_image; |
380 u_int32_t checksum; /* 0 if unknown */ | 380 uint32_t checksum; /* 0 if unknown */ |
381 u_int32_t time_date_stamp; /* time_t */ | 381 uint32_t time_date_stamp; /* time_t */ |
382 MDRVA module_name_rva; /* MDString, pathname or filename */ | 382 MDRVA module_name_rva; /* MDString, pathname or filename */ |
383 MDVSFixedFileInfo version_info; | 383 MDVSFixedFileInfo version_info; |
384 | 384 |
385 /* The next field stores a CodeView record and is populated when a module's | 385 /* The next field stores a CodeView record and is populated when a module's |
386 * debug information resides in a PDB file. It identifies the PDB file. */ | 386 * debug information resides in a PDB file. It identifies the PDB file. */ |
387 MDLocationDescriptor cv_record; | 387 MDLocationDescriptor cv_record; |
388 | 388 |
389 /* The next field is populated when a module's debug information resides | 389 /* The next field is populated when a module's debug information resides |
390 * in a DBG file. It identifies the DBG file. This field is effectively | 390 * in a DBG file. It identifies the DBG file. This field is effectively |
391 * obsolete with modules built by recent toolchains. */ | 391 * obsolete with modules built by recent toolchains. */ |
392 MDLocationDescriptor misc_record; | 392 MDLocationDescriptor misc_record; |
393 | 393 |
394 /* Alignment problem: reserved0 and reserved1 are defined by the platform | 394 /* Alignment problem: reserved0 and reserved1 are defined by the platform |
395 * SDK as 64-bit quantities. However, that results in a structure whose | 395 * SDK as 64-bit quantities. However, that results in a structure whose |
396 * alignment is unpredictable on different CPUs and ABIs. If the ABI | 396 * alignment is unpredictable on different CPUs and ABIs. If the ABI |
397 * specifies full alignment of 64-bit quantities in structures (as ppc | 397 * specifies full alignment of 64-bit quantities in structures (as ppc |
398 * does), there will be padding between miscRecord and reserved0. If | 398 * does), there will be padding between miscRecord and reserved0. If |
399 * 64-bit quantities can be aligned on 32-bit boundaries (as on x86), | 399 * 64-bit quantities can be aligned on 32-bit boundaries (as on x86), |
400 * this padding will not exist. (Note that the structure up to this point | 400 * this padding will not exist. (Note that the structure up to this point |
401 * contains 1 64-bit member followed by 21 32-bit members.) | 401 * contains 1 64-bit member followed by 21 32-bit members.) |
402 * As a workaround, reserved0 and reserved1 are instead defined here as | 402 * As a workaround, reserved0 and reserved1 are instead defined here as |
403 * four 32-bit quantities. This should be harmless, as there are | 403 * four 32-bit quantities. This should be harmless, as there are |
404 * currently no known uses for these fields. */ | 404 * currently no known uses for these fields. */ |
405 u_int32_t reserved0[2]; | 405 uint32_t reserved0[2]; |
406 u_int32_t reserved1[2]; | 406 uint32_t reserved1[2]; |
407 } MDRawModule; /* MINIDUMP_MODULE */ | 407 } MDRawModule; /* MINIDUMP_MODULE */ |
408 | 408 |
409 /* The inclusion of a 64-bit type in MINIDUMP_MODULE forces the struct to | 409 /* The inclusion of a 64-bit type in MINIDUMP_MODULE forces the struct to |
410 * be tail-padded out to a multiple of 64 bits under some ABIs (such as PPC). | 410 * be tail-padded out to a multiple of 64 bits under some ABIs (such as PPC). |
411 * This doesn't occur on systems that don't tail-pad in this manner. Define | 411 * This doesn't occur on systems that don't tail-pad in this manner. Define |
412 * this macro to be the usable size of the MDRawModule struct, and use it in | 412 * this macro to be the usable size of the MDRawModule struct, and use it in |
413 * place of sizeof(MDRawModule). */ | 413 * place of sizeof(MDRawModule). */ |
414 #define MD_MODULE_SIZE 108 | 414 #define MD_MODULE_SIZE 108 |
415 | 415 |
416 | 416 |
417 /* (MDRawModule).cv_record can reference MDCVInfoPDB20 or MDCVInfoPDB70. | 417 /* (MDRawModule).cv_record can reference MDCVInfoPDB20 or MDCVInfoPDB70. |
418 * Ref.: http://www.debuginfo.com/articles/debuginfomatch.html | 418 * Ref.: http://www.debuginfo.com/articles/debuginfomatch.html |
419 * MDCVInfoPDB70 is the expected structure type with recent toolchains. */ | 419 * MDCVInfoPDB70 is the expected structure type with recent toolchains. */ |
420 | 420 |
421 typedef struct { | 421 typedef struct { |
422 u_int32_t signature; | 422 uint32_t signature; |
423 u_int32_t offset; /* Offset to debug data (expect 0 in minidump) */ | 423 uint32_t offset; /* Offset to debug data (expect 0 in minidump) */ |
424 } MDCVHeader; | 424 } MDCVHeader; |
425 | 425 |
426 typedef struct { | 426 typedef struct { |
427 MDCVHeader cv_header; | 427 MDCVHeader cv_header; |
428 u_int32_t signature; /* time_t debug information created */ | 428 uint32_t signature; /* time_t debug information created */ |
429 u_int32_t age; /* revision of PDB file */ | 429 uint32_t age; /* revision of PDB file */ |
430 u_int8_t pdb_file_name[1]; /* Pathname or filename of PDB file */ | 430 uint8_t pdb_file_name[1]; /* Pathname or filename of PDB file */ |
431 } MDCVInfoPDB20; | 431 } MDCVInfoPDB20; |
432 | 432 |
433 static const size_t MDCVInfoPDB20_minsize = offsetof(MDCVInfoPDB20, | 433 static const size_t MDCVInfoPDB20_minsize = offsetof(MDCVInfoPDB20, |
434 pdb_file_name[0]); | 434 pdb_file_name[0]); |
435 | 435 |
436 #define MD_CVINFOPDB20_SIGNATURE 0x3031424e /* cvHeader.signature = '01BN' */ | 436 #define MD_CVINFOPDB20_SIGNATURE 0x3031424e /* cvHeader.signature = '01BN' */ |
437 | 437 |
438 typedef struct { | 438 typedef struct { |
439 u_int32_t cv_signature; | 439 uint32_t cv_signature; |
440 MDGUID signature; /* GUID, identifies PDB file */ | 440 MDGUID signature; /* GUID, identifies PDB file */ |
441 u_int32_t age; /* Identifies incremental changes to PDB file */ | 441 uint32_t age; /* Identifies incremental changes to PDB file */ |
442 u_int8_t pdb_file_name[1]; /* Pathname or filename of PDB file, | 442 uint8_t pdb_file_name[1]; /* Pathname or filename of PDB file, |
443 * 0-terminated 8-bit character data (UTF-8?) */ | 443 * 0-terminated 8-bit character data (UTF-8?) */ |
444 } MDCVInfoPDB70; | 444 } MDCVInfoPDB70; |
445 | 445 |
446 static const size_t MDCVInfoPDB70_minsize = offsetof(MDCVInfoPDB70, | 446 static const size_t MDCVInfoPDB70_minsize = offsetof(MDCVInfoPDB70, |
447 pdb_file_name[0]); | 447 pdb_file_name[0]); |
448 | 448 |
449 #define MD_CVINFOPDB70_SIGNATURE 0x53445352 /* cvSignature = 'SDSR' */ | 449 #define MD_CVINFOPDB70_SIGNATURE 0x53445352 /* cvSignature = 'SDSR' */ |
450 | 450 |
451 typedef struct { | 451 typedef struct { |
452 u_int32_t data1[2]; | 452 uint32_t data1[2]; |
453 u_int32_t data2; | 453 uint32_t data2; |
454 u_int32_t data3; | 454 uint32_t data3; |
455 u_int32_t data4; | 455 uint32_t data4; |
456 u_int32_t data5[3]; | 456 uint32_t data5[3]; |
457 u_int8_t extra[2]; | 457 uint8_t extra[2]; |
458 } MDCVInfoELF; | 458 } MDCVInfoELF; |
459 | 459 |
460 /* In addition to the two CodeView record formats above, used for linking | 460 /* In addition to the two CodeView record formats above, used for linking |
461 * to external pdb files, it is possible for debugging data to be carried | 461 * to external pdb files, it is possible for debugging data to be carried |
462 * directly in the CodeView record itself. These signature values will | 462 * directly in the CodeView record itself. These signature values will |
463 * be found in the first 4 bytes of the CodeView record. Additional values | 463 * be found in the first 4 bytes of the CodeView record. Additional values |
464 * not commonly experienced in the wild are given by "Microsoft Symbol and | 464 * not commonly experienced in the wild are given by "Microsoft Symbol and |
465 * Type Information", http://www.x86.org/ftp/manuals/tools/sym.pdf, section | 465 * Type Information", http://www.x86.org/ftp/manuals/tools/sym.pdf, section |
466 * 7.2. An in-depth description of the CodeView 4.1 format is given by | 466 * 7.2. An in-depth description of the CodeView 4.1 format is given by |
467 * "Undocumented Windows 2000 Secrets", Windows 2000 Debugging Support/ | 467 * "Undocumented Windows 2000 Secrets", Windows 2000 Debugging Support/ |
468 * Microsoft Symbol File Internals/CodeView Subsections, | 468 * Microsoft Symbol File Internals/CodeView Subsections, |
469 * http://www.rawol.com/features/undocumented/sbs-w2k-1-windows-2000-debugging-s
upport.pdf | 469 * http://www.rawol.com/features/undocumented/sbs-w2k-1-windows-2000-debugging-s
upport.pdf |
470 */ | 470 */ |
471 #define MD_CVINFOCV41_SIGNATURE 0x3930424e /* '90BN', CodeView 4.10. */ | 471 #define MD_CVINFOCV41_SIGNATURE 0x3930424e /* '90BN', CodeView 4.10. */ |
472 #define MD_CVINFOCV50_SIGNATURE 0x3131424e /* '11BN', CodeView 5.0, | 472 #define MD_CVINFOCV50_SIGNATURE 0x3131424e /* '11BN', CodeView 5.0, |
473 * MS C7-format (/Z7). */ | 473 * MS C7-format (/Z7). */ |
474 | 474 |
475 #define MD_CVINFOUNKNOWN_SIGNATURE 0xffffffff /* An unlikely value. */ | 475 #define MD_CVINFOUNKNOWN_SIGNATURE 0xffffffff /* An unlikely value. */ |
476 | 476 |
477 /* (MDRawModule).miscRecord can reference MDImageDebugMisc. The Windows | 477 /* (MDRawModule).miscRecord can reference MDImageDebugMisc. The Windows |
478 * structure is actually defined in WinNT.h. This structure is effectively | 478 * structure is actually defined in WinNT.h. This structure is effectively |
479 * obsolete with modules built by recent toolchains. */ | 479 * obsolete with modules built by recent toolchains. */ |
480 | 480 |
481 typedef struct { | 481 typedef struct { |
482 u_int32_t data_type; /* IMAGE_DEBUG_TYPE_*, not defined here because | 482 uint32_t data_type; /* IMAGE_DEBUG_TYPE_*, not defined here because |
483 * this debug record type is mostly obsolete. */ | 483 * this debug record type is mostly obsolete. */ |
484 u_int32_t length; /* Length of entire MDImageDebugMisc structure */ | 484 uint32_t length; /* Length of entire MDImageDebugMisc structure */ |
485 u_int8_t unicode; /* True if data is multibyte */ | 485 uint8_t unicode; /* True if data is multibyte */ |
486 u_int8_t reserved[3]; | 486 uint8_t reserved[3]; |
487 u_int8_t data[1]; | 487 uint8_t data[1]; |
488 } MDImageDebugMisc; /* IMAGE_DEBUG_MISC */ | 488 } MDImageDebugMisc; /* IMAGE_DEBUG_MISC */ |
489 | 489 |
490 static const size_t MDImageDebugMisc_minsize = offsetof(MDImageDebugMisc, | 490 static const size_t MDImageDebugMisc_minsize = offsetof(MDImageDebugMisc, |
491 data[0]); | 491 data[0]); |
492 | 492 |
493 | 493 |
494 typedef struct { | 494 typedef struct { |
495 u_int32_t number_of_modules; | 495 uint32_t number_of_modules; |
496 MDRawModule modules[1]; | 496 MDRawModule modules[1]; |
497 } MDRawModuleList; /* MINIDUMP_MODULE_LIST */ | 497 } MDRawModuleList; /* MINIDUMP_MODULE_LIST */ |
498 | 498 |
499 static const size_t MDRawModuleList_minsize = offsetof(MDRawModuleList, | 499 static const size_t MDRawModuleList_minsize = offsetof(MDRawModuleList, |
500 modules[0]); | 500 modules[0]); |
501 | 501 |
502 | 502 |
503 typedef struct { | 503 typedef struct { |
504 u_int32_t number_of_memory_ranges; | 504 uint32_t number_of_memory_ranges; |
505 MDMemoryDescriptor memory_ranges[1]; | 505 MDMemoryDescriptor memory_ranges[1]; |
506 } MDRawMemoryList; /* MINIDUMP_MEMORY_LIST */ | 506 } MDRawMemoryList; /* MINIDUMP_MEMORY_LIST */ |
507 | 507 |
508 static const size_t MDRawMemoryList_minsize = offsetof(MDRawMemoryList, | 508 static const size_t MDRawMemoryList_minsize = offsetof(MDRawMemoryList, |
509 memory_ranges[0]); | 509 memory_ranges[0]); |
510 | 510 |
511 | 511 |
512 #define MD_EXCEPTION_MAXIMUM_PARAMETERS 15 | 512 #define MD_EXCEPTION_MAXIMUM_PARAMETERS 15 |
513 | 513 |
514 typedef struct { | 514 typedef struct { |
515 u_int32_t exception_code; /* Windows: MDExceptionCodeWin, | 515 uint32_t exception_code; /* Windows: MDExceptionCodeWin, |
516 * Mac OS X: MDExceptionMac, | 516 * Mac OS X: MDExceptionMac, |
517 * Linux: MDExceptionCodeLinux. */ | 517 * Linux: MDExceptionCodeLinux. */ |
518 u_int32_t exception_flags; /* Windows: 1 if noncontinuable, | 518 uint32_t exception_flags; /* Windows: 1 if noncontinuable, |
519 Mac OS X: MDExceptionCodeMac. */ | 519 Mac OS X: MDExceptionCodeMac. */ |
520 u_int64_t exception_record; /* Address (in the minidump-producing host's | 520 uint64_t exception_record; /* Address (in the minidump-producing host's |
521 * memory) of another MDException, for | 521 * memory) of another MDException, for |
522 * nested exceptions. */ | 522 * nested exceptions. */ |
523 u_int64_t exception_address; /* The address that caused the exception. | 523 uint64_t exception_address; /* The address that caused the exception. |
524 * Mac OS X: exception subcode (which is | 524 * Mac OS X: exception subcode (which is |
525 * typically the address). */ | 525 * typically the address). */ |
526 u_int32_t number_parameters; /* Number of valid elements in | 526 uint32_t number_parameters; /* Number of valid elements in |
527 * exception_information. */ | 527 * exception_information. */ |
528 u_int32_t __align; | 528 uint32_t __align; |
529 u_int64_t exception_information[MD_EXCEPTION_MAXIMUM_PARAMETERS]; | 529 uint64_t exception_information[MD_EXCEPTION_MAXIMUM_PARAMETERS]; |
530 } MDException; /* MINIDUMP_EXCEPTION */ | 530 } MDException; /* MINIDUMP_EXCEPTION */ |
531 | 531 |
532 #include "minidump_exception_win32.h" | 532 #include "minidump_exception_win32.h" |
533 #include "minidump_exception_mac.h" | 533 #include "minidump_exception_mac.h" |
534 #include "minidump_exception_linux.h" | 534 #include "minidump_exception_linux.h" |
535 #include "minidump_exception_solaris.h" | 535 #include "minidump_exception_solaris.h" |
536 | 536 |
537 typedef struct { | 537 typedef struct { |
538 u_int32_t thread_id; /* Thread in which the exception | 538 uint32_t thread_id; /* Thread in which the exception |
539 * occurred. Corresponds to | 539 * occurred. Corresponds to |
540 * (MDRawThread).thread_id. */ | 540 * (MDRawThread).thread_id. */ |
541 u_int32_t __align; | 541 uint32_t __align; |
542 MDException exception_record; | 542 MDException exception_record; |
543 MDLocationDescriptor thread_context; /* MDRawContext[CPU] */ | 543 MDLocationDescriptor thread_context; /* MDRawContext[CPU] */ |
544 } MDRawExceptionStream; /* MINIDUMP_EXCEPTION_STREAM */ | 544 } MDRawExceptionStream; /* MINIDUMP_EXCEPTION_STREAM */ |
545 | 545 |
546 | 546 |
547 typedef union { | 547 typedef union { |
548 struct { | 548 struct { |
549 u_int32_t vendor_id[3]; /* cpuid 0: ebx, edx, ecx */ | 549 uint32_t vendor_id[3]; /* cpuid 0: ebx, edx, ecx */ |
550 u_int32_t version_information; /* cpuid 1: eax */ | 550 uint32_t version_information; /* cpuid 1: eax */ |
551 u_int32_t feature_information; /* cpuid 1: edx */ | 551 uint32_t feature_information; /* cpuid 1: edx */ |
552 u_int32_t amd_extended_cpu_features; /* cpuid 0x80000001, ebx */ | 552 uint32_t amd_extended_cpu_features; /* cpuid 0x80000001, ebx */ |
553 } x86_cpu_info; | 553 } x86_cpu_info; |
554 struct { | 554 struct { |
555 u_int64_t processor_features[2]; | 555 uint64_t processor_features[2]; |
556 } other_cpu_info; | 556 } other_cpu_info; |
557 } MDCPUInformation; /* CPU_INFORMATION */ | 557 } MDCPUInformation; /* CPU_INFORMATION */ |
558 | 558 |
559 | 559 |
560 typedef struct { | 560 typedef struct { |
561 /* The next 3 fields and numberOfProcessors are from the SYSTEM_INFO | 561 /* The next 3 fields and numberOfProcessors are from the SYSTEM_INFO |
562 * structure as returned by GetSystemInfo */ | 562 * structure as returned by GetSystemInfo */ |
563 u_int16_t processor_architecture; | 563 uint16_t processor_architecture; |
564 u_int16_t processor_level; /* x86: 5 = 586, 6 = 686, ... */ | 564 uint16_t processor_level; /* x86: 5 = 586, 6 = 686, ... */ |
565 u_int16_t processor_revision; /* x86: 0xMMSS, where MM=model, | 565 uint16_t processor_revision; /* x86: 0xMMSS, where MM=model, |
566 * SS=stepping */ | 566 * SS=stepping */ |
567 | 567 |
568 u_int8_t number_of_processors; | 568 uint8_t number_of_processors; |
569 u_int8_t product_type; /* Windows: VER_NT_* from WinNT.h */ | 569 uint8_t product_type; /* Windows: VER_NT_* from WinNT.h */ |
570 | 570 |
571 /* The next 5 fields are from the OSVERSIONINFO structure as returned | 571 /* The next 5 fields are from the OSVERSIONINFO structure as returned |
572 * by GetVersionEx */ | 572 * by GetVersionEx */ |
573 u_int32_t major_version; | 573 uint32_t major_version; |
574 u_int32_t minor_version; | 574 uint32_t minor_version; |
575 u_int32_t build_number; | 575 uint32_t build_number; |
576 u_int32_t platform_id; | 576 uint32_t platform_id; |
577 MDRVA csd_version_rva; /* MDString further identifying the | 577 MDRVA csd_version_rva; /* MDString further identifying the |
578 * host OS. | 578 * host OS. |
579 * Windows: name of the installed OS | 579 * Windows: name of the installed OS |
580 * service pack. | 580 * service pack. |
581 * Mac OS X: the Apple OS build number | 581 * Mac OS X: the Apple OS build number |
582 * (sw_vers -buildVersion). | 582 * (sw_vers -buildVersion). |
583 * Linux: uname -srvmo */ | 583 * Linux: uname -srvmo */ |
584 | 584 |
585 u_int16_t suite_mask; /* Windows: VER_SUITE_* from WinNT.h */ | 585 uint16_t suite_mask; /* Windows: VER_SUITE_* from WinNT.h */ |
586 u_int16_t reserved2; | 586 uint16_t reserved2; |
587 | 587 |
588 MDCPUInformation cpu; | 588 MDCPUInformation cpu; |
589 } MDRawSystemInfo; /* MINIDUMP_SYSTEM_INFO */ | 589 } MDRawSystemInfo; /* MINIDUMP_SYSTEM_INFO */ |
590 | 590 |
591 /* For (MDRawSystemInfo).processor_architecture: */ | 591 /* For (MDRawSystemInfo).processor_architecture: */ |
592 typedef enum { | 592 typedef enum { |
593 MD_CPU_ARCHITECTURE_X86 = 0, /* PROCESSOR_ARCHITECTURE_INTEL */ | 593 MD_CPU_ARCHITECTURE_X86 = 0, /* PROCESSOR_ARCHITECTURE_INTEL */ |
594 MD_CPU_ARCHITECTURE_MIPS = 1, /* PROCESSOR_ARCHITECTURE_MIPS */ | 594 MD_CPU_ARCHITECTURE_MIPS = 1, /* PROCESSOR_ARCHITECTURE_MIPS */ |
595 MD_CPU_ARCHITECTURE_ALPHA = 2, /* PROCESSOR_ARCHITECTURE_ALPHA */ | 595 MD_CPU_ARCHITECTURE_ALPHA = 2, /* PROCESSOR_ARCHITECTURE_ALPHA */ |
596 MD_CPU_ARCHITECTURE_PPC = 3, /* PROCESSOR_ARCHITECTURE_PPC */ | 596 MD_CPU_ARCHITECTURE_PPC = 3, /* PROCESSOR_ARCHITECTURE_PPC */ |
(...skipping 23 matching lines...) Expand all Loading... |
620 MD_OS_UNIX = 0x8000, /* Generic Unix-ish */ | 620 MD_OS_UNIX = 0x8000, /* Generic Unix-ish */ |
621 MD_OS_MAC_OS_X = 0x8101, /* Mac OS X/Darwin */ | 621 MD_OS_MAC_OS_X = 0x8101, /* Mac OS X/Darwin */ |
622 MD_OS_IOS = 0x8102, /* iOS */ | 622 MD_OS_IOS = 0x8102, /* iOS */ |
623 MD_OS_LINUX = 0x8201, /* Linux */ | 623 MD_OS_LINUX = 0x8201, /* Linux */ |
624 MD_OS_SOLARIS = 0x8202, /* Solaris */ | 624 MD_OS_SOLARIS = 0x8202, /* Solaris */ |
625 MD_OS_ANDROID = 0x8203 /* Android */ | 625 MD_OS_ANDROID = 0x8203 /* Android */ |
626 } MDOSPlatform; | 626 } MDOSPlatform; |
627 | 627 |
628 | 628 |
629 typedef struct { | 629 typedef struct { |
630 u_int32_t size_of_info; /* Length of entire MDRawMiscInfo structure. */ | 630 uint32_t size_of_info; /* Length of entire MDRawMiscInfo structure. */ |
631 u_int32_t flags1; | 631 uint32_t flags1; |
632 | 632 |
633 /* The next field is only valid if flags1 contains | 633 /* The next field is only valid if flags1 contains |
634 * MD_MISCINFO_FLAGS1_PROCESS_ID. */ | 634 * MD_MISCINFO_FLAGS1_PROCESS_ID. */ |
635 u_int32_t process_id; | 635 uint32_t process_id; |
636 | 636 |
637 /* The next 3 fields are only valid if flags1 contains | 637 /* The next 3 fields are only valid if flags1 contains |
638 * MD_MISCINFO_FLAGS1_PROCESS_TIMES. */ | 638 * MD_MISCINFO_FLAGS1_PROCESS_TIMES. */ |
639 u_int32_t process_create_time; /* time_t process started */ | 639 uint32_t process_create_time; /* time_t process started */ |
640 u_int32_t process_user_time; /* seconds of user CPU time */ | 640 uint32_t process_user_time; /* seconds of user CPU time */ |
641 u_int32_t process_kernel_time; /* seconds of kernel CPU time */ | 641 uint32_t process_kernel_time; /* seconds of kernel CPU time */ |
642 | 642 |
643 /* The following fields are not present in MINIDUMP_MISC_INFO but are | 643 /* The following fields are not present in MINIDUMP_MISC_INFO but are |
644 * in MINIDUMP_MISC_INFO_2. When this struct is populated, these values | 644 * in MINIDUMP_MISC_INFO_2. When this struct is populated, these values |
645 * may not be set. Use flags1 or sizeOfInfo to determine whether these | 645 * may not be set. Use flags1 or sizeOfInfo to determine whether these |
646 * values are present. These are only valid when flags1 contains | 646 * values are present. These are only valid when flags1 contains |
647 * MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO. */ | 647 * MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO. */ |
648 u_int32_t processor_max_mhz; | 648 uint32_t processor_max_mhz; |
649 u_int32_t processor_current_mhz; | 649 uint32_t processor_current_mhz; |
650 u_int32_t processor_mhz_limit; | 650 uint32_t processor_mhz_limit; |
651 u_int32_t processor_max_idle_state; | 651 uint32_t processor_max_idle_state; |
652 u_int32_t processor_current_idle_state; | 652 uint32_t processor_current_idle_state; |
653 } MDRawMiscInfo; /* MINIDUMP_MISC_INFO, MINIDUMP_MISC_INFO2 */ | 653 } MDRawMiscInfo; /* MINIDUMP_MISC_INFO, MINIDUMP_MISC_INFO2 */ |
654 | 654 |
655 #define MD_MISCINFO_SIZE 24 | 655 #define MD_MISCINFO_SIZE 24 |
656 #define MD_MISCINFO2_SIZE 44 | 656 #define MD_MISCINFO2_SIZE 44 |
657 | 657 |
658 /* For (MDRawMiscInfo).flags1. These values indicate which fields in the | 658 /* For (MDRawMiscInfo).flags1. These values indicate which fields in the |
659 * MDRawMiscInfoStructure are valid. */ | 659 * MDRawMiscInfoStructure are valid. */ |
660 typedef enum { | 660 typedef enum { |
661 MD_MISCINFO_FLAGS1_PROCESS_ID = 0x00000001, | 661 MD_MISCINFO_FLAGS1_PROCESS_ID = 0x00000001, |
662 /* MINIDUMP_MISC1_PROCESS_ID */ | 662 /* MINIDUMP_MISC1_PROCESS_ID */ |
663 MD_MISCINFO_FLAGS1_PROCESS_TIMES = 0x00000002, | 663 MD_MISCINFO_FLAGS1_PROCESS_TIMES = 0x00000002, |
664 /* MINIDUMP_MISC1_PROCESS_TIMES */ | 664 /* MINIDUMP_MISC1_PROCESS_TIMES */ |
665 MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO = 0x00000004 | 665 MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO = 0x00000004 |
666 /* MINIDUMP_MISC1_PROCESSOR_POWER_INFO */ | 666 /* MINIDUMP_MISC1_PROCESSOR_POWER_INFO */ |
667 } MDMiscInfoFlags1; | 667 } MDMiscInfoFlags1; |
668 | 668 |
669 /* | 669 /* |
670 * Around DbgHelp version 6.0, the style of new LIST structures changed | 670 * Around DbgHelp version 6.0, the style of new LIST structures changed |
671 * from including an array of length 1 at the end of the struct to | 671 * from including an array of length 1 at the end of the struct to |
672 * represent the variable-length data to including explicit | 672 * represent the variable-length data to including explicit |
673 * "size of header", "size of entry" and "number of entries" fields | 673 * "size of header", "size of entry" and "number of entries" fields |
674 * in the header, presumably to allow backwards-compatibly-extending | 674 * in the header, presumably to allow backwards-compatibly-extending |
675 * the structures in the future. The actual list entries follow the | 675 * the structures in the future. The actual list entries follow the |
676 * header data directly in this case. | 676 * header data directly in this case. |
677 */ | 677 */ |
678 | 678 |
679 typedef struct { | 679 typedef struct { |
680 u_int32_t size_of_header; /* sizeof(MDRawMemoryInfoList) */ | 680 uint32_t size_of_header; /* sizeof(MDRawMemoryInfoList) */ |
681 u_int32_t size_of_entry; /* sizeof(MDRawMemoryInfo) */ | 681 uint32_t size_of_entry; /* sizeof(MDRawMemoryInfo) */ |
682 u_int64_t number_of_entries; | 682 uint64_t number_of_entries; |
683 } MDRawMemoryInfoList; /* MINIDUMP_MEMORY_INFO_LIST */ | 683 } MDRawMemoryInfoList; /* MINIDUMP_MEMORY_INFO_LIST */ |
684 | 684 |
685 typedef struct { | 685 typedef struct { |
686 u_int64_t base_address; /* Base address of a region of pages */ | 686 uint64_t base_address; /* Base address of a region of pages */ |
687 u_int64_t allocation_base; /* Base address of a range of pages | 687 uint64_t allocation_base; /* Base address of a range of pages |
688 * within this region. */ | 688 * within this region. */ |
689 u_int32_t allocation_protection; /* Memory protection when this region | 689 uint32_t allocation_protection; /* Memory protection when this region |
690 * was originally allocated: | 690 * was originally allocated: |
691 * MDMemoryProtection */ | 691 * MDMemoryProtection */ |
692 u_int32_t __alignment1; | 692 uint32_t __alignment1; |
693 u_int64_t region_size; | 693 uint64_t region_size; |
694 u_int32_t state; /* MDMemoryState */ | 694 uint32_t state; /* MDMemoryState */ |
695 u_int32_t protection; /* MDMemoryProtection */ | 695 uint32_t protection; /* MDMemoryProtection */ |
696 u_int32_t type; /* MDMemoryType */ | 696 uint32_t type; /* MDMemoryType */ |
697 u_int32_t __alignment2; | 697 uint32_t __alignment2; |
698 } MDRawMemoryInfo; /* MINIDUMP_MEMORY_INFO */ | 698 } MDRawMemoryInfo; /* MINIDUMP_MEMORY_INFO */ |
699 | 699 |
700 /* For (MDRawMemoryInfo).state */ | 700 /* For (MDRawMemoryInfo).state */ |
701 typedef enum { | 701 typedef enum { |
702 MD_MEMORY_STATE_COMMIT = 0x1000, /* physical storage has been allocated */ | 702 MD_MEMORY_STATE_COMMIT = 0x1000, /* physical storage has been allocated */ |
703 MD_MEMORY_STATE_RESERVE = 0x2000, /* reserved, but no physical storage */ | 703 MD_MEMORY_STATE_RESERVE = 0x2000, /* reserved, but no physical storage */ |
704 MD_MEMORY_STATE_FREE = 0x10000 /* available to be allocated */ | 704 MD_MEMORY_STATE_FREE = 0x10000 /* available to be allocated */ |
705 } MDMemoryState; | 705 } MDMemoryState; |
706 | 706 |
707 /* For (MDRawMemoryInfo).allocation_protection and .protection */ | 707 /* For (MDRawMemoryInfo).allocation_protection and .protection */ |
708 typedef enum { | 708 typedef enum { |
709 MD_MEMORY_PROTECT_NOACCESS = 0x01, /* PAGE_NOACCESS */ | 709 MD_MEMORY_PROTECT_NOACCESS = 0x01, /* PAGE_NOACCESS */ |
710 MD_MEMORY_PROTECT_READONLY = 0x02, /* PAGE_READONLY */ | 710 MD_MEMORY_PROTECT_READONLY = 0x02, /* PAGE_READONLY */ |
711 MD_MEMORY_PROTECT_READWRITE = 0x04, /* PAGE_READWRITE */ | 711 MD_MEMORY_PROTECT_READWRITE = 0x04, /* PAGE_READWRITE */ |
712 MD_MEMORY_PROTECT_WRITECOPY = 0x08, /* PAGE_WRITECOPY */ | 712 MD_MEMORY_PROTECT_WRITECOPY = 0x08, /* PAGE_WRITECOPY */ |
713 MD_MEMORY_PROTECT_EXECUTE = 0x10, /* PAGE_EXECUTE */ | 713 MD_MEMORY_PROTECT_EXECUTE = 0x10, /* PAGE_EXECUTE */ |
714 MD_MEMORY_PROTECT_EXECUTE_READ = 0x20, /* PAGE_EXECUTE_READ */ | 714 MD_MEMORY_PROTECT_EXECUTE_READ = 0x20, /* PAGE_EXECUTE_READ */ |
715 MD_MEMORY_PROTECT_EXECUTE_READWRITE = 0x40, /* PAGE_EXECUTE_READWRITE */ | 715 MD_MEMORY_PROTECT_EXECUTE_READWRITE = 0x40, /* PAGE_EXECUTE_READWRITE */ |
716 MD_MEMORY_PROTECT_EXECUTE_WRITECOPY = 0x80, /* PAGE_EXECUTE_WRITECOPY */ | 716 MD_MEMORY_PROTECT_EXECUTE_WRITECOPY = 0x80, /* PAGE_EXECUTE_WRITECOPY */ |
717 /* These options can be combined with the previous flags. */ | 717 /* These options can be combined with the previous flags. */ |
718 MD_MEMORY_PROTECT_GUARD = 0x100, /* PAGE_GUARD */ | 718 MD_MEMORY_PROTECT_GUARD = 0x100, /* PAGE_GUARD */ |
719 MD_MEMORY_PROTECT_NOCACHE = 0x200, /* PAGE_NOCACHE */ | 719 MD_MEMORY_PROTECT_NOCACHE = 0x200, /* PAGE_NOCACHE */ |
720 MD_MEMORY_PROTECT_WRITECOMBINE = 0x400, /* PAGE_WRITECOMBINE */ | 720 MD_MEMORY_PROTECT_WRITECOMBINE = 0x400, /* PAGE_WRITECOMBINE */ |
721 } MDMemoryProtection; | 721 } MDMemoryProtection; |
722 | 722 |
723 /* Used to mask the mutually exclusive options from the combinable flags. */ | 723 /* Used to mask the mutually exclusive options from the combinable flags. */ |
724 const u_int32_t MD_MEMORY_PROTECTION_ACCESS_MASK = 0xFF; | 724 const uint32_t MD_MEMORY_PROTECTION_ACCESS_MASK = 0xFF; |
725 | 725 |
726 /* For (MDRawMemoryInfo).type */ | 726 /* For (MDRawMemoryInfo).type */ |
727 typedef enum { | 727 typedef enum { |
728 MD_MEMORY_TYPE_PRIVATE = 0x20000, /* not shared by other processes */ | 728 MD_MEMORY_TYPE_PRIVATE = 0x20000, /* not shared by other processes */ |
729 MD_MEMORY_TYPE_MAPPED = 0x40000, /* mapped into the view of a section */ | 729 MD_MEMORY_TYPE_MAPPED = 0x40000, /* mapped into the view of a section */ |
730 MD_MEMORY_TYPE_IMAGE = 0x1000000 /* mapped into the view of an image */ | 730 MD_MEMORY_TYPE_IMAGE = 0x1000000 /* mapped into the view of an image */ |
731 } MDMemoryType; | 731 } MDMemoryType; |
732 | 732 |
733 /* | 733 /* |
734 * Breakpad extension types | 734 * Breakpad extension types |
735 */ | 735 */ |
736 | 736 |
737 | 737 |
738 typedef struct { | 738 typedef struct { |
739 /* validity is a bitmask with values from MDBreakpadInfoValidity, indicating | 739 /* validity is a bitmask with values from MDBreakpadInfoValidity, indicating |
740 * which of the other fields in the structure are valid. */ | 740 * which of the other fields in the structure are valid. */ |
741 u_int32_t validity; | 741 uint32_t validity; |
742 | 742 |
743 /* Thread ID of the handler thread. dump_thread_id should correspond to | 743 /* Thread ID of the handler thread. dump_thread_id should correspond to |
744 * the thread_id of an MDRawThread in the minidump's MDRawThreadList if | 744 * the thread_id of an MDRawThread in the minidump's MDRawThreadList if |
745 * a dedicated thread in that list was used to produce the minidump. If | 745 * a dedicated thread in that list was used to produce the minidump. If |
746 * the MDRawThreadList does not contain a dedicated thread used to produce | 746 * the MDRawThreadList does not contain a dedicated thread used to produce |
747 * the minidump, this field should be set to 0 and the validity field | 747 * the minidump, this field should be set to 0 and the validity field |
748 * must not contain MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID. */ | 748 * must not contain MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID. */ |
749 u_int32_t dump_thread_id; | 749 uint32_t dump_thread_id; |
750 | 750 |
751 /* Thread ID of the thread that requested the minidump be produced. As | 751 /* Thread ID of the thread that requested the minidump be produced. As |
752 * with dump_thread_id, requesting_thread_id should correspond to the | 752 * with dump_thread_id, requesting_thread_id should correspond to the |
753 * thread_id of an MDRawThread in the minidump's MDRawThreadList. For | 753 * thread_id of an MDRawThread in the minidump's MDRawThreadList. For |
754 * minidumps produced as a result of an exception, requesting_thread_id | 754 * minidumps produced as a result of an exception, requesting_thread_id |
755 * will be the same as the MDRawExceptionStream's thread_id field. For | 755 * will be the same as the MDRawExceptionStream's thread_id field. For |
756 * minidumps produced "manually" at the program's request, | 756 * minidumps produced "manually" at the program's request, |
757 * requesting_thread_id will indicate which thread caused the dump to be | 757 * requesting_thread_id will indicate which thread caused the dump to be |
758 * written. If the minidump was produced at the request of something | 758 * written. If the minidump was produced at the request of something |
759 * other than a thread in the MDRawThreadList, this field should be set | 759 * other than a thread in the MDRawThreadList, this field should be set |
760 * to 0 and the validity field must not contain | 760 * to 0 and the validity field must not contain |
761 * MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID. */ | 761 * MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID. */ |
762 u_int32_t requesting_thread_id; | 762 uint32_t requesting_thread_id; |
763 } MDRawBreakpadInfo; | 763 } MDRawBreakpadInfo; |
764 | 764 |
765 /* For (MDRawBreakpadInfo).validity: */ | 765 /* For (MDRawBreakpadInfo).validity: */ |
766 typedef enum { | 766 typedef enum { |
767 /* When set, the dump_thread_id field is valid. */ | 767 /* When set, the dump_thread_id field is valid. */ |
768 MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID = 1 << 0, | 768 MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID = 1 << 0, |
769 | 769 |
770 /* When set, the requesting_thread_id field is valid. */ | 770 /* When set, the requesting_thread_id field is valid. */ |
771 MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID = 1 << 1 | 771 MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID = 1 << 1 |
772 } MDBreakpadInfoValidity; | 772 } MDBreakpadInfoValidity; |
773 | 773 |
774 typedef struct { | 774 typedef struct { |
775 /* expression, function, and file are 0-terminated UTF-16 strings. They | 775 /* expression, function, and file are 0-terminated UTF-16 strings. They |
776 * may be truncated if necessary, but should always be 0-terminated when | 776 * may be truncated if necessary, but should always be 0-terminated when |
777 * written to a file. | 777 * written to a file. |
778 * Fixed-length strings are used because MiniDumpWriteDump doesn't offer | 778 * Fixed-length strings are used because MiniDumpWriteDump doesn't offer |
779 * a way for user streams to point to arbitrary RVAs for strings. */ | 779 * a way for user streams to point to arbitrary RVAs for strings. */ |
780 u_int16_t expression[128]; /* Assertion that failed... */ | 780 uint16_t expression[128]; /* Assertion that failed... */ |
781 u_int16_t function[128]; /* ...within this function... */ | 781 uint16_t function[128]; /* ...within this function... */ |
782 u_int16_t file[128]; /* ...in this file... */ | 782 uint16_t file[128]; /* ...in this file... */ |
783 u_int32_t line; /* ...at this line. */ | 783 uint32_t line; /* ...at this line. */ |
784 u_int32_t type; | 784 uint32_t type; |
785 } MDRawAssertionInfo; | 785 } MDRawAssertionInfo; |
786 | 786 |
787 /* For (MDRawAssertionInfo).type: */ | 787 /* For (MDRawAssertionInfo).type: */ |
788 typedef enum { | 788 typedef enum { |
789 MD_ASSERTION_INFO_TYPE_UNKNOWN = 0, | 789 MD_ASSERTION_INFO_TYPE_UNKNOWN = 0, |
790 | 790 |
791 /* Used for assertions that would be raised by the MSVC CRT but are | 791 /* Used for assertions that would be raised by the MSVC CRT but are |
792 * directed to an invalid parameter handler instead. */ | 792 * directed to an invalid parameter handler instead. */ |
793 MD_ASSERTION_INFO_TYPE_INVALID_PARAMETER, | 793 MD_ASSERTION_INFO_TYPE_INVALID_PARAMETER, |
794 | 794 |
795 /* Used for assertions that would be raised by the MSVC CRT but are | 795 /* Used for assertions that would be raised by the MSVC CRT but are |
796 * directed to a pure virtual call handler instead. */ | 796 * directed to a pure virtual call handler instead. */ |
797 MD_ASSERTION_INFO_TYPE_PURE_VIRTUAL_CALL | 797 MD_ASSERTION_INFO_TYPE_PURE_VIRTUAL_CALL |
798 } MDAssertionInfoData; | 798 } MDAssertionInfoData; |
799 | 799 |
800 /* These structs are used to store the DSO debug data in Linux minidumps, | 800 /* These structs are used to store the DSO debug data in Linux minidumps, |
801 * which is necessary for converting minidumps to usable coredumps. */ | 801 * which is necessary for converting minidumps to usable coredumps. */ |
802 typedef struct { | 802 typedef struct { |
803 void* addr; | 803 void* addr; |
804 MDRVA name; | 804 MDRVA name; |
805 void* ld; | 805 void* ld; |
806 } MDRawLinkMap; | 806 } MDRawLinkMap; |
807 | 807 |
808 typedef struct { | 808 typedef struct { |
809 u_int32_t version; | 809 uint32_t version; |
810 MDRVA map; | 810 MDRVA map; |
811 u_int32_t dso_count; | 811 uint32_t dso_count; |
812 void* brk; | 812 void* brk; |
813 void* ldbase; | 813 void* ldbase; |
814 void* dynamic; | 814 void* dynamic; |
815 } MDRawDebug; | 815 } MDRawDebug; |
816 | 816 |
817 #if defined(_MSC_VER) | 817 #if defined(_MSC_VER) |
818 #pragma warning(pop) | 818 #pragma warning(pop) |
819 #endif /* _MSC_VER */ | 819 #endif /* _MSC_VER */ |
820 | 820 |
821 | 821 |
822 #endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_FORMAT_H__ */ | 822 #endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_FORMAT_H__ */ |
OLD | NEW |