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, |
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_CLIENT_CRASHPAD_INFO_H_ | 15 #ifndef CRASHPAD_CLIENT_CRASHPAD_INFO_H_ |
16 #define CRASHPAD_CLIENT_CRASHPAD_INFO_H_ | 16 #define CRASHPAD_CLIENT_CRASHPAD_INFO_H_ |
17 | 17 |
18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
19 | 19 |
20 #include <stdint.h> | 20 #include <stdint.h> |
21 | 21 |
22 #include "build/build_config.h" | |
22 #include "client/simple_string_dictionary.h" | 23 #include "client/simple_string_dictionary.h" |
23 #include "util/misc/tri_state.h" | 24 #include "util/misc/tri_state.h" |
24 | 25 |
26 #if defined(OS_WIN) | |
27 #include "util/win/address_types.h" | |
28 #endif // OS_WIN | |
29 | |
25 namespace crashpad { | 30 namespace crashpad { |
26 | 31 |
27 //! \brief A structure that can be used by a Crashpad-enabled program to | 32 //! \brief A structure that can be used by a Crashpad-enabled program to |
28 //! provide information to the Crashpad crash handler. | 33 //! provide information to the Crashpad crash handler. |
29 //! | 34 //! |
30 //! It is possible for one CrashpadInfo structure to appear in each loaded code | 35 //! It is possible for one CrashpadInfo structure to appear in each loaded code |
31 //! module in a process, but from the perspective of the user of the client | 36 //! module in a process, but from the perspective of the user of the client |
32 //! interface, there is only one global CrashpadInfo structure, located in the | 37 //! interface, there is only one global CrashpadInfo structure, located in the |
33 //! module that contains the client interface code. | 38 //! module that contains the client interface code. |
34 struct CrashpadInfo { | 39 struct CrashpadInfo { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 //! disabled by SetCrashpadHandlerState(). Even when forwarding is enabled, | 91 //! disabled by SetCrashpadHandlerState(). Even when forwarding is enabled, |
87 //! the Crashpad handler may choose not to forward all exceptions to the | 92 //! the Crashpad handler may choose not to forward all exceptions to the |
88 //! system’s crash reporter in cases where it has reason to believe that the | 93 //! system’s crash reporter in cases where it has reason to believe that the |
89 //! system’s crash reporter would not normally have handled the exception in | 94 //! system’s crash reporter would not normally have handled the exception in |
90 //! Crashpad’s absence. | 95 //! Crashpad’s absence. |
91 void set_system_crash_reporter_forwarding( | 96 void set_system_crash_reporter_forwarding( |
92 TriState system_crash_reporter_forwarding) { | 97 TriState system_crash_reporter_forwarding) { |
93 system_crash_reporter_forwarding_ = system_crash_reporter_forwarding; | 98 system_crash_reporter_forwarding_ = system_crash_reporter_forwarding; |
94 } | 99 } |
95 | 100 |
101 #if defined(OS_WIN) | |
102 void set_exception_pointers(WinVMAddress exception_pointers) { | |
103 exception_pointers_ = exception_pointers; | |
104 } | |
105 #endif // OS_WIN | |
106 | |
96 enum : uint32_t { | 107 enum : uint32_t { |
97 kSignature = 'CPad', | 108 kSignature = 'CPad', |
98 }; | 109 }; |
99 | 110 |
100 private: | 111 private: |
101 // The compiler won’t necessarily see anyone using these fields, but it | 112 // The compiler won’t necessarily see anyone using these fields, but it |
102 // shouldn’t warn about that. These fields aren’t intended for use by the | 113 // shouldn’t warn about that. These fields aren’t intended for use by the |
103 // process they’re found in, they’re supposed to be read by the crash | 114 // process they’re found in, they’re supposed to be read by the crash |
104 // reporting process. | 115 // reporting process. |
105 #if defined(__clang__) | 116 #if defined(__clang__) |
106 #pragma clang diagnostic push | 117 #pragma clang diagnostic push |
107 #pragma clang diagnostic ignored "-Wunused-private-field" | 118 #pragma clang diagnostic ignored "-Wunused-private-field" |
108 #endif | 119 #endif |
109 | 120 |
110 // Fields present in version 1: | 121 // Fields present in version 1: |
111 uint32_t signature_; // kSignature | 122 uint32_t signature_; // kSignature |
112 uint32_t size_; // The size of the entire CrashpadInfo structure. | 123 uint32_t size_; // The size of the entire CrashpadInfo structure. |
113 uint32_t version_; // kVersion | 124 uint32_t version_; // kVersion |
114 TriState crashpad_handler_behavior_; | 125 TriState crashpad_handler_behavior_; |
115 TriState system_crash_reporter_forwarding_; | 126 TriState system_crash_reporter_forwarding_; |
116 uint16_t padding_0_; | 127 uint16_t padding_0_; |
117 SimpleStringDictionary* simple_annotations_; // weak | 128 SimpleStringDictionary* simple_annotations_; // weak |
118 | 129 |
130 #if defined(OS_WIN) | |
131 WinVMAddress exception_pointers_; | |
Mark Mentovai
2015/08/13 13:38:53
Since this always points to the local address spac
scottmg
2015/08/13 22:43:22
Done.
| |
132 #endif // OS_WIN | |
133 | |
119 #if defined(__clang__) | 134 #if defined(__clang__) |
120 #pragma clang diagnostic pop | 135 #pragma clang diagnostic pop |
121 #endif | 136 #endif |
122 | 137 |
123 DISALLOW_COPY_AND_ASSIGN(CrashpadInfo); | 138 DISALLOW_COPY_AND_ASSIGN(CrashpadInfo); |
124 }; | 139 }; |
125 | 140 |
126 } // namespace crashpad | 141 } // namespace crashpad |
127 | 142 |
128 #endif // CRASHPAD_CLIENT_CRASHPAD_INFO_H_ | 143 #endif // CRASHPAD_CLIENT_CRASHPAD_INFO_H_ |
OLD | NEW |