Planeshift
minidump_size.h
Go to the documentation of this file.
1
// Copyright (c) 2007, Google Inc.
2
// All rights reserved.
3
//
4
// Redistribution and use in source and binary forms, with or without
5
// modification, are permitted provided that the following conditions are
6
// met:
7
//
8
// * Redistributions of source code must retain the above copyright
9
// notice, this list of conditions and the following disclaimer.
10
// * Redistributions in binary form must reproduce the above
11
// copyright notice, this list of conditions and the following disclaimer
12
// in the documentation and/or other materials provided with the
13
// distribution.
14
// * Neither the name of Google Inc. nor the names of its
15
// contributors may be used to endorse or promote products derived from
16
// this software without specific prior written permission.
17
//
18
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
29
30
// minidump_size.h: Provides a C++ template for programmatic access to
31
// the sizes of various types defined in minidump_format.h.
32
//
33
// Author: Mark Mentovai
34
35
#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_SIZE_H__
36
#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_SIZE_H__
37
38
#include <sys/types.h>
39
40
#include "
google_breakpad/common/minidump_format.h
"
41
42
namespace
google_breakpad
{
43
44
template
<
typename
T>
45
class
minidump_size
{
46
public
:
47
static
size_t
size
() {
return
sizeof
(T); }
48
};
49
50
// Explicit specializations for variable-length types. The size returned
51
// for these should be the size for an object without its variable-length
52
// section.
53
54
template
<>
55
class
minidump_size
<
MDString
> {
56
public
:
57
static
size_t
size
() {
return
MDString_minsize
; }
58
};
59
60
template
<>
61
class
minidump_size
<
MDRawThreadList
> {
62
public
:
63
static
size_t
size
() {
return
MDRawThreadList_minsize
; }
64
};
65
66
template
<>
67
class
minidump_size
<
MDCVInfoPDB20
> {
68
public
:
69
static
size_t
size
() {
return
MDCVInfoPDB20_minsize
; }
70
};
71
72
template
<>
73
class
minidump_size
<
MDCVInfoPDB70
> {
74
public
:
75
static
size_t
size
() {
return
MDCVInfoPDB70_minsize
; }
76
};
77
78
template
<>
79
class
minidump_size
<
MDImageDebugMisc
> {
80
public
:
81
static
size_t
size
() {
return
MDImageDebugMisc_minsize
; }
82
};
83
84
template
<>
85
class
minidump_size
<
MDRawModuleList
> {
86
public
:
87
static
size_t
size
() {
return
MDRawModuleList_minsize
; }
88
};
89
90
template
<>
91
class
minidump_size
<
MDRawMemoryList
> {
92
public
:
93
static
size_t
size
() {
return
MDRawMemoryList_minsize
; }
94
};
95
96
// Explicit specialization for MDRawModule, for which sizeof may include
97
// tail-padding on some architectures but not others.
98
99
template
<>
100
class
minidump_size
<
MDRawModule
> {
101
public
:
102
static
size_t
size
() {
return
MD_MODULE_SIZE
; }
103
};
104
105
}
// namespace google_breakpad
106
107
#endif // GOOGLE_BREAKPAD_COMMON_MINIDUMP_SIZE_H__
MDRawModuleList
Definition:
minidump_format.h:494
MDRawModule
Definition:
minidump_format.h:377
MD_MODULE_SIZE
#define MD_MODULE_SIZE
Definition:
minidump_format.h:414
google_breakpad::minidump_size< MDCVInfoPDB20 >::size
static size_t size()
Definition:
minidump_size.h:69
MDImageDebugMisc
Definition:
minidump_format.h:481
MDString_minsize
static const size_t MDString_minsize
Definition:
minidump_format.h:354
google_breakpad::minidump_size< MDRawMemoryList >::size
static size_t size()
Definition:
minidump_size.h:93
MDRawThreadList
Definition:
minidump_format.h:368
google_breakpad::minidump_size< MDRawModule >::size
static size_t size()
Definition:
minidump_size.h:102
MDRawMemoryList
Definition:
minidump_format.h:503
MDRawThreadList_minsize
static const size_t MDRawThreadList_minsize
Definition:
minidump_format.h:373
google_breakpad
Definition:
crash_generation_client.h:35
google_breakpad::minidump_size
Definition:
minidump_size.h:45
minidump_format.h
MDCVInfoPDB20_minsize
static const size_t MDCVInfoPDB20_minsize
Definition:
minidump_format.h:433
google_breakpad::minidump_size< MDImageDebugMisc >::size
static size_t size()
Definition:
minidump_size.h:81
google_breakpad::minidump_size< MDCVInfoPDB70 >::size
static size_t size()
Definition:
minidump_size.h:75
MDRawMemoryList_minsize
static const size_t MDRawMemoryList_minsize
Definition:
minidump_format.h:508
google_breakpad::minidump_size< MDString >::size
static size_t size()
Definition:
minidump_size.h:57
google_breakpad::minidump_size::size
static size_t size()
Definition:
minidump_size.h:47
MDString
Definition:
minidump_format.h:348
MDCVInfoPDB20
Definition:
minidump_format.h:426
MDImageDebugMisc_minsize
static const size_t MDImageDebugMisc_minsize
Definition:
minidump_format.h:490
MDRawModuleList_minsize
static const size_t MDRawModuleList_minsize
Definition:
minidump_format.h:499
google_breakpad::minidump_size< MDRawThreadList >::size
static size_t size()
Definition:
minidump_size.h:63
MDCVInfoPDB70_minsize
static const size_t MDCVInfoPDB70_minsize
Definition:
minidump_format.h:446
MDCVInfoPDB70
Definition:
minidump_format.h:438
google_breakpad::minidump_size< MDRawModuleList >::size
static size_t size()
Definition:
minidump_size.h:87
tools
breakpad
google_breakpad
common
minidump_size.h
Generated on Sat Jun 19 2021 05:00:34 for Planeshift by
1.8.11