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

Side by Side Diff: third_party/crashpad/crashpad/minidump/minidump_extensions.h

Issue 2670873002: Remove base's ALIGNOF/ALIGNAS in favor of alignof/alignas. (Closed)
Patch Set: rebase Created 3 years, 10 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
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,
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // 0x4350 = "CP" 95 // 0x4350 = "CP"
96 96
97 //! \brief The stream type for MinidumpCrashpadInfo. 97 //! \brief The stream type for MinidumpCrashpadInfo.
98 kMinidumpStreamTypeCrashpadInfo = 0x43500001, 98 kMinidumpStreamTypeCrashpadInfo = 0x43500001,
99 }; 99 };
100 100
101 //! \brief A variable-length UTF-8-encoded string carried within a minidump 101 //! \brief A variable-length UTF-8-encoded string carried within a minidump
102 //! file. 102 //! file.
103 //! 103 //!
104 //! \sa MINIDUMP_STRING 104 //! \sa MINIDUMP_STRING
105 struct ALIGNAS(4) PACKED MinidumpUTF8String { 105 struct alignas(4) MinidumpUTF8String {
106 // The field names do not conform to typical style, they match the names used 106 // The field names do not conform to typical style, they match the names used
107 // in MINIDUMP_STRING. This makes it easier to operate on MINIDUMP_STRING (for 107 // in MINIDUMP_STRING. This makes it easier to operate on MINIDUMP_STRING (for
108 // UTF-16 strings) and MinidumpUTF8String using templates. 108 // UTF-16 strings) and MinidumpUTF8String using templates.
109 109
110 //! \brief The length of the #Buffer field in bytes, not including the `NUL` 110 //! \brief The length of the #Buffer field in bytes, not including the `NUL`
111 //! terminator. 111 //! terminator.
112 //! 112 //!
113 //! \note This field is interpreted as a byte count, not a count of Unicode 113 //! \note This field is interpreted as a byte count, not a count of Unicode
114 //! code points. 114 //! code points.
115 uint32_t Length; 115 uint32_t Length;
116 116
117 //! \brief The string, encoded in UTF-8, and terminated with a `NUL` byte. 117 //! \brief The string, encoded in UTF-8, and terminated with a `NUL` byte.
118 uint8_t Buffer[0]; 118 uint8_t Buffer[0];
119 }; 119 } PACKED;
120 120
121 //! \brief CPU type values for MINIDUMP_SYSTEM_INFO::ProcessorArchitecture. 121 //! \brief CPU type values for MINIDUMP_SYSTEM_INFO::ProcessorArchitecture.
122 //! 122 //!
123 //! \sa \ref PROCESSOR_ARCHITECTURE_x "PROCESSOR_ARCHITECTURE_*" 123 //! \sa \ref PROCESSOR_ARCHITECTURE_x "PROCESSOR_ARCHITECTURE_*"
124 enum MinidumpCPUArchitecture : uint16_t { 124 enum MinidumpCPUArchitecture : uint16_t {
125 //! \brief 32-bit x86. 125 //! \brief 32-bit x86.
126 //! 126 //!
127 //! These systems identify their CPUs generically as “x86” or “ia32”, or with 127 //! These systems identify their CPUs generically as “x86” or “ia32”, or with
128 //! more specific names such as “i386”, “i486”, “i586”, and “i686”. 128 //! more specific names such as “i386”, “i486”, “i586”, and “i686”.
129 kMinidumpCPUArchitectureX86 = PROCESSOR_ARCHITECTURE_INTEL, 129 kMinidumpCPUArchitectureX86 = PROCESSOR_ARCHITECTURE_INTEL,
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 //! \brief Native Client (NaCl). 237 //! \brief Native Client (NaCl).
238 kMinidumpOSNaCl = 0x8205, 238 kMinidumpOSNaCl = 0x8205,
239 239
240 //! \brief Unknown operating system. 240 //! \brief Unknown operating system.
241 kMinidumpOSUnknown = 0xffffffff, 241 kMinidumpOSUnknown = 0xffffffff,
242 }; 242 };
243 243
244 244
245 //! \brief A list of ::RVA pointers. 245 //! \brief A list of ::RVA pointers.
246 struct ALIGNAS(4) PACKED MinidumpRVAList { 246 struct alignas(4) MinidumpRVAList {
247 //! \brief The number of children present in the #children array. 247 //! \brief The number of children present in the #children array.
248 uint32_t count; 248 uint32_t count;
249 249
250 //! \brief Pointers to other structures in the minidump file. 250 //! \brief Pointers to other structures in the minidump file.
251 RVA children[0]; 251 RVA children[0];
252 }; 252 } PACKED;
253 253
254 //! \brief A key-value pair. 254 //! \brief A key-value pair.
255 struct ALIGNAS(4) PACKED MinidumpSimpleStringDictionaryEntry { 255 struct alignas(4) MinidumpSimpleStringDictionaryEntry {
256 //! \brief ::RVA of a MinidumpUTF8String containing the key of a key-value 256 //! \brief ::RVA of a MinidumpUTF8String containing the key of a key-value
257 //! pair. 257 //! pair.
258 RVA key; 258 RVA key;
259 259
260 //! \brief ::RVA of a MinidumpUTF8String containing the value of a key-value 260 //! \brief ::RVA of a MinidumpUTF8String containing the value of a key-value
261 //! pair. 261 //! pair.
262 RVA value; 262 RVA value;
263 }; 263 } PACKED;
264 264
265 //! \brief A list of key-value pairs. 265 //! \brief A list of key-value pairs.
266 struct ALIGNAS(4) PACKED MinidumpSimpleStringDictionary { 266 struct alignas(4) MinidumpSimpleStringDictionary {
267 //! \brief The number of key-value pairs present. 267 //! \brief The number of key-value pairs present.
268 uint32_t count; 268 uint32_t count;
269 269
270 //! \brief A list of MinidumpSimpleStringDictionaryEntry entries. 270 //! \brief A list of MinidumpSimpleStringDictionaryEntry entries.
271 MinidumpSimpleStringDictionaryEntry entries[0]; 271 MinidumpSimpleStringDictionaryEntry entries[0];
272 }; 272 } PACKED;
273 273
274 //! \brief Additional Crashpad-specific information about a module carried 274 //! \brief Additional Crashpad-specific information about a module carried
275 //! within a minidump file. 275 //! within a minidump file.
276 //! 276 //!
277 //! This structure augments the information provided by MINIDUMP_MODULE. The 277 //! This structure augments the information provided by MINIDUMP_MODULE. The
278 //! minidump file must contain a module list stream 278 //! minidump file must contain a module list stream
279 //! (::kMinidumpStreamTypeModuleList) in order for this structure to appear. 279 //! (::kMinidumpStreamTypeModuleList) in order for this structure to appear.
280 //! 280 //!
281 //! This structure is versioned. When changing this structure, leave the 281 //! This structure is versioned. When changing this structure, leave the
282 //! existing structure intact so that earlier parsers will be able to understand 282 //! existing structure intact so that earlier parsers will be able to understand
283 //! the fields they are aware of, and make additions at the end of the 283 //! the fields they are aware of, and make additions at the end of the
284 //! structure. Revise #kVersion and document each field’s validity based on 284 //! structure. Revise #kVersion and document each field’s validity based on
285 //! #version, so that newer parsers will be able to determine whether the added 285 //! #version, so that newer parsers will be able to determine whether the added
286 //! fields are valid or not. 286 //! fields are valid or not.
287 //! 287 //!
288 //! \sa MinidumpModuleCrashpadInfoList 288 //! \sa MinidumpModuleCrashpadInfoList
289 struct ALIGNAS(4) PACKED MinidumpModuleCrashpadInfo { 289 struct alignas(4) MinidumpModuleCrashpadInfo {
290 //! \brief The structure’s currently-defined version number. 290 //! \brief The structure’s currently-defined version number.
291 //! 291 //!
292 //! \sa version 292 //! \sa version
293 static const uint32_t kVersion = 1; 293 static const uint32_t kVersion = 1;
294 294
295 //! \brief The structure’s version number. 295 //! \brief The structure’s version number.
296 //! 296 //!
297 //! Readers can use this field to determine which other fields in the 297 //! Readers can use this field to determine which other fields in the
298 //! structure are valid. Upon encountering a value greater than #kVersion, a 298 //! structure are valid. Upon encountering a value greater than #kVersion, a
299 //! reader should assume that the structure’s layout is compatible with the 299 //! reader should assume that the structure’s layout is compatible with the
(...skipping 14 matching lines...) Expand all
314 314
315 //! \brief A MinidumpSimpleStringDictionary pointing to strings interpreted as 315 //! \brief A MinidumpSimpleStringDictionary pointing to strings interpreted as
316 //! key-value pairs. The module controls the data that appears here. 316 //! key-value pairs. The module controls the data that appears here.
317 //! 317 //!
318 //! These key-value pairs correspond to 318 //! These key-value pairs correspond to
319 //! ModuleSnapshot::AnnotationsSimpleMap() and do not duplicate anything in 319 //! ModuleSnapshot::AnnotationsSimpleMap() and do not duplicate anything in
320 //! #list_annotations. 320 //! #list_annotations.
321 //! 321 //!
322 //! This field is present when #version is at least `1`. 322 //! This field is present when #version is at least `1`.
323 MINIDUMP_LOCATION_DESCRIPTOR simple_annotations; 323 MINIDUMP_LOCATION_DESCRIPTOR simple_annotations;
324 }; 324 } PACKED;
325 325
326 //! \brief A link between a MINIDUMP_MODULE structure and additional 326 //! \brief A link between a MINIDUMP_MODULE structure and additional
327 //! Crashpad-specific information about a module carried within a minidump 327 //! Crashpad-specific information about a module carried within a minidump
328 //! file. 328 //! file.
329 struct ALIGNAS(4) PACKED MinidumpModuleCrashpadInfoLink { 329 struct alignas(4) MinidumpModuleCrashpadInfoLink {
330 //! \brief A link to a MINIDUMP_MODULE structure in the module list stream. 330 //! \brief A link to a MINIDUMP_MODULE structure in the module list stream.
331 //! 331 //!
332 //! This field is an index into MINIDUMP_MODULE_LIST::Modules. This field’s 332 //! This field is an index into MINIDUMP_MODULE_LIST::Modules. This field’s
333 //! value must be in the range of MINIDUMP_MODULE_LIST::NumberOfEntries. 333 //! value must be in the range of MINIDUMP_MODULE_LIST::NumberOfEntries.
334 uint32_t minidump_module_list_index; 334 uint32_t minidump_module_list_index;
335 335
336 //! \brief A link to a MinidumpModuleCrashpadInfo structure. 336 //! \brief A link to a MinidumpModuleCrashpadInfo structure.
337 //! 337 //!
338 //! MinidumpModuleCrashpadInfo structures are accessed indirectly through 338 //! MinidumpModuleCrashpadInfo structures are accessed indirectly through
339 //! MINIDUMP_LOCATION_DESCRIPTOR pointers to allow for future growth of the 339 //! MINIDUMP_LOCATION_DESCRIPTOR pointers to allow for future growth of the
340 //! MinidumpModuleCrashpadInfo structure. 340 //! MinidumpModuleCrashpadInfo structure.
341 MINIDUMP_LOCATION_DESCRIPTOR location; 341 MINIDUMP_LOCATION_DESCRIPTOR location;
342 }; 342 } PACKED;
343 343
344 //! \brief Additional Crashpad-specific information about modules carried within 344 //! \brief Additional Crashpad-specific information about modules carried within
345 //! a minidump file. 345 //! a minidump file.
346 //! 346 //!
347 //! This structure augments the information provided by 347 //! This structure augments the information provided by
348 //! MINIDUMP_MODULE_LIST. The minidump file must contain a module list stream 348 //! MINIDUMP_MODULE_LIST. The minidump file must contain a module list stream
349 //! (::kMinidumpStreamTypeModuleList) in order for this structure to appear. 349 //! (::kMinidumpStreamTypeModuleList) in order for this structure to appear.
350 //! 350 //!
351 //! MinidumpModuleCrashpadInfoList::count may be less than the value of 351 //! MinidumpModuleCrashpadInfoList::count may be less than the value of
352 //! MINIDUMP_MODULE_LIST::NumberOfModules because not every MINIDUMP_MODULE 352 //! MINIDUMP_MODULE_LIST::NumberOfModules because not every MINIDUMP_MODULE
353 //! structure carried within the minidump file will necessarily have 353 //! structure carried within the minidump file will necessarily have
354 //! Crashpad-specific information provided by a MinidumpModuleCrashpadInfo 354 //! Crashpad-specific information provided by a MinidumpModuleCrashpadInfo
355 //! structure. 355 //! structure.
356 struct ALIGNAS(4) PACKED MinidumpModuleCrashpadInfoList { 356 struct alignas(4) MinidumpModuleCrashpadInfoList {
357 //! \brief The number of children present in the #modules array. 357 //! \brief The number of children present in the #modules array.
358 uint32_t count; 358 uint32_t count;
359 359
360 //! \brief Crashpad-specific information about modules, along with links to 360 //! \brief Crashpad-specific information about modules, along with links to
361 //! MINIDUMP_MODULE structures that contain module information 361 //! MINIDUMP_MODULE structures that contain module information
362 //! traditionally carried within minidump files. 362 //! traditionally carried within minidump files.
363 MinidumpModuleCrashpadInfoLink modules[0]; 363 MinidumpModuleCrashpadInfoLink modules[0];
364 }; 364 } PACKED;
365 365
366 //! \brief Additional Crashpad-specific information carried within a minidump 366 //! \brief Additional Crashpad-specific information carried within a minidump
367 //! file. 367 //! file.
368 //! 368 //!
369 //! This structure is versioned. When changing this structure, leave the 369 //! This structure is versioned. When changing this structure, leave the
370 //! existing structure intact so that earlier parsers will be able to understand 370 //! existing structure intact so that earlier parsers will be able to understand
371 //! the fields they are aware of, and make additions at the end of the 371 //! the fields they are aware of, and make additions at the end of the
372 //! structure. Revise #kVersion and document each field’s validity based on 372 //! structure. Revise #kVersion and document each field’s validity based on
373 //! #version, so that newer parsers will be able to determine whether the added 373 //! #version, so that newer parsers will be able to determine whether the added
374 //! fields are valid or not. 374 //! fields are valid or not.
375 struct ALIGNAS(4) PACKED MinidumpCrashpadInfo { 375 struct alignas(4) MinidumpCrashpadInfo {
376 // UUID has a constructor, which makes it non-POD, which makes this structure 376 // UUID has a constructor, which makes it non-POD, which makes this structure
377 // non-POD. In order for the default constructor to zero-initialize other 377 // non-POD. In order for the default constructor to zero-initialize other
378 // members, an explicit constructor must be provided. 378 // members, an explicit constructor must be provided.
379 MinidumpCrashpadInfo() 379 MinidumpCrashpadInfo()
380 : version(), 380 : version(),
381 report_id(), 381 report_id(),
382 client_id(), 382 client_id(),
383 simple_annotations(), 383 simple_annotations(),
384 module_list() { 384 module_list() {
385 } 385 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 //! These key-value pairs correspond to 429 //! These key-value pairs correspond to
430 //! ProcessSnapshot::AnnotationsSimpleMap(). 430 //! ProcessSnapshot::AnnotationsSimpleMap().
431 //! 431 //!
432 //! This field is present when #version is at least `1`. 432 //! This field is present when #version is at least `1`.
433 MINIDUMP_LOCATION_DESCRIPTOR simple_annotations; 433 MINIDUMP_LOCATION_DESCRIPTOR simple_annotations;
434 434
435 //! \brief A pointer to a MinidumpModuleCrashpadInfoList structure. 435 //! \brief A pointer to a MinidumpModuleCrashpadInfoList structure.
436 //! 436 //!
437 //! This field is present when #version is at least `1`. 437 //! This field is present when #version is at least `1`.
438 MINIDUMP_LOCATION_DESCRIPTOR module_list; 438 MINIDUMP_LOCATION_DESCRIPTOR module_list;
439 }; 439 } PACKED;
440 440
441 #if defined(COMPILER_MSVC) 441 #if defined(COMPILER_MSVC)
442 #pragma pack(pop) 442 #pragma pack(pop)
443 #endif // COMPILER_MSVC 443 #endif // COMPILER_MSVC
444 #undef PACKED 444 #undef PACKED
445 445
446 MSVC_POP_WARNING(); // C4200 446 MSVC_POP_WARNING(); // C4200
447 447
448 } // namespace crashpad 448 } // namespace crashpad
449 449
450 #endif // CRASHPAD_MINIDUMP_MINIDUMP_EXTENSIONS_H_ 450 #endif // CRASHPAD_MINIDUMP_MINIDUMP_EXTENSIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698