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, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 //! \brief Indicates the validity of non-control segment registers | 86 //! \brief Indicates the validity of non-control segment registers |
87 //! (`CONTEXT_SEGMENTS`). | 87 //! (`CONTEXT_SEGMENTS`). |
88 //! | 88 //! |
89 //! The `gs`, `fs`, `es`, and `ds` fields are valid. | 89 //! The `gs`, `fs`, `es`, and `ds` fields are valid. |
90 kMinidumpContextX86Segment = kMinidumpContextX86 | 0x00000004, | 90 kMinidumpContextX86Segment = kMinidumpContextX86 | 0x00000004, |
91 | 91 |
92 //! \brief Indicates the validity of floating-point state | 92 //! \brief Indicates the validity of floating-point state |
93 //! (`CONTEXT_FLOATING_POINT`). | 93 //! (`CONTEXT_FLOATING_POINT`). |
94 //! | 94 //! |
95 //! The `float_save` field is valid. | 95 //! The `fsave` field is valid. The `float_save` field is included in this |
| 96 //! definition, but its members have no practical use asdie from `fsave`. |
96 kMinidumpContextX86FloatingPoint = kMinidumpContextX86 | 0x00000008, | 97 kMinidumpContextX86FloatingPoint = kMinidumpContextX86 | 0x00000008, |
97 | 98 |
98 //! \brief Indicates the validity of debug registers | 99 //! \brief Indicates the validity of debug registers |
99 //! (`CONTEXT_DEBUG_REGISTERS`). | 100 //! (`CONTEXT_DEBUG_REGISTERS`). |
100 //! | 101 //! |
101 //! The `dr0` through `dr3`, `dr6`, and `dr7` fields are valid. | 102 //! The `dr0` through `dr3`, `dr6`, and `dr7` fields are valid. |
102 kMinidumpContextX86Debug = kMinidumpContextX86 | 0x00000010, | 103 kMinidumpContextX86Debug = kMinidumpContextX86 | 0x00000010, |
103 | 104 |
104 //! \brief Indicates the validity of extended registers in `fxsave` format | 105 //! \brief Indicates the validity of extended registers in `fxsave` format |
105 //! (`CONTEXT_EXTENDED_REGISTERS`). | 106 //! (`CONTEXT_EXTENDED_REGISTERS`). |
(...skipping 17 matching lines...) Expand all Loading... |
123 //! (`CONTEXT_ALL`). | 124 //! (`CONTEXT_ALL`). |
124 kMinidumpContextX86All = kMinidumpContextX86Full | | 125 kMinidumpContextX86All = kMinidumpContextX86Full | |
125 kMinidumpContextX86FloatingPoint | | 126 kMinidumpContextX86FloatingPoint | |
126 kMinidumpContextX86Debug | | 127 kMinidumpContextX86Debug | |
127 kMinidumpContextX86Extended, | 128 kMinidumpContextX86Extended, |
128 }; | 129 }; |
129 | 130 |
130 //! \brief A 32-bit x86 CPU context (register state) carried in a minidump file. | 131 //! \brief A 32-bit x86 CPU context (register state) carried in a minidump file. |
131 //! | 132 //! |
132 //! This is analogous to the `CONTEXT` structure on Windows when targeting | 133 //! This is analogous to the `CONTEXT` structure on Windows when targeting |
133 //! 32-bit x86. This structure is used instead of `CONTEXT` to make it available | 134 //! 32-bit x86, and the `WOW64_CONTEXT` structure when targeting an x86-family |
134 //! when targeting other architectures. | 135 //! CPU, either 32- or 64-bit. This structure is used instead of `CONTEXT` or |
| 136 //! `WOW64_CONTEXT` to make it available when targeting other architectures. |
135 //! | 137 //! |
136 //! \note This structure doesn’t carry `dr4` or `dr5`, which are obsolete and | 138 //! \note This structure doesn’t carry `dr4` or `dr5`, which are obsolete and |
137 //! normally alias `dr6` and `dr7`, respectively. See Intel Software | 139 //! normally alias `dr6` and `dr7`, respectively. See Intel Software |
138 //! Developer’s Manual, Volume 3B: System Programming, Part 2 (253669-052), | 140 //! Developer’s Manual, Volume 3B: System Programming, Part 2 (253669-052), |
139 //! 17.2.2 “Debug Registers DR4 and DR5”. | 141 //! 17.2.2 “Debug Registers DR4 and DR5”. |
140 struct MinidumpContextX86 { | 142 struct MinidumpContextX86 { |
141 //! \brief A bitfield composed of values of #MinidumpContextFlags and | 143 //! \brief A bitfield composed of values of #MinidumpContextFlags and |
142 //! #MinidumpContextX86Flags. | 144 //! #MinidumpContextX86Flags. |
143 //! | 145 //! |
144 //! This field identifies the context structure as a 32-bit x86 CPU context, | 146 //! This field identifies the context structure as a 32-bit x86 CPU context, |
145 //! and indicates which other fields in the structure are valid. | 147 //! and indicates which other fields in the structure are valid. |
146 uint32_t context_flags; | 148 uint32_t context_flags; |
147 | 149 |
148 uint32_t dr0; | 150 uint32_t dr0; |
149 uint32_t dr1; | 151 uint32_t dr1; |
150 uint32_t dr2; | 152 uint32_t dr2; |
151 uint32_t dr3; | 153 uint32_t dr3; |
152 uint32_t dr6; | 154 uint32_t dr6; |
153 uint32_t dr7; | 155 uint32_t dr7; |
154 | 156 |
155 struct { | 157 // CPUContextX86::Fsave has identical layout to what the x86 CONTEXT |
156 uint32_t control_word; | 158 // structure places here. |
157 uint32_t status_word; | 159 CPUContextX86::Fsave fsave; |
158 uint32_t tag_word; | 160 union { |
159 uint32_t error_offset; | 161 uint32_t spare_0; // As in the native x86 CONTEXT structure since Windows 8 |
160 uint32_t error_selector; | 162 uint32_t cr0_npx_state; // As in WOW64_CONTEXT and older SDKs’ x86 CONTEXT |
161 uint32_t data_offset; | |
162 uint32_t data_selector; | |
163 uint8_t register_area[80]; | |
164 uint32_t spare_0; | |
165 } float_save; | 163 } float_save; |
166 | 164 |
167 uint32_t gs; | 165 uint32_t gs; |
168 uint32_t fs; | 166 uint32_t fs; |
169 uint32_t es; | 167 uint32_t es; |
170 uint32_t ds; | 168 uint32_t ds; |
171 | 169 |
172 uint32_t edi; | 170 uint32_t edi; |
173 uint32_t esi; | 171 uint32_t esi; |
174 uint32_t ebx; | 172 uint32_t ebx; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 uint64_t last_branch_to_rip; | 333 uint64_t last_branch_to_rip; |
336 uint64_t last_branch_from_rip; | 334 uint64_t last_branch_from_rip; |
337 uint64_t last_exception_to_rip; | 335 uint64_t last_exception_to_rip; |
338 uint64_t last_exception_from_rip; | 336 uint64_t last_exception_from_rip; |
339 //! \} | 337 //! \} |
340 }; | 338 }; |
341 | 339 |
342 } // namespace crashpad | 340 } // namespace crashpad |
343 | 341 |
344 #endif // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_ | 342 #endif // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_ |
OLD | NEW |