OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
| 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (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 |
| 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. |
| 14 |
| 15 #ifndef CRASHPAD_CLIENT_CAPTURE_CONTEXT_WIN_H_ |
| 16 #define CRASHPAD_CLIENT_CAPTURE_CONTEXT_WIN_H_ |
| 17 |
| 18 #include <windows.h> |
| 19 |
| 20 namespace crashpad { |
| 21 |
| 22 //! \brief Saves the CPU context. |
| 23 //! |
| 24 //! The CPU context will be captured as accurately and completely as possible, |
| 25 //! containing an atomic snapshot at the point of this function’s return. This |
| 26 //! function does not modify any registers. |
| 27 //! |
| 28 //! This function captures all integer registers as well as the floating-point |
| 29 //! and vector (SSE) state. It does not capture debug registers, which are |
| 30 //! inaccessible by user code. |
| 31 //! |
| 32 //! This function is a replacement for `RtlCaptureContext()`, which contains |
| 33 //! bugs and limitations. On 32-bit x86, `RtlCaptureContext()` requires that |
| 34 //! `ebp` be used as a frame pointer, and returns `ebp`, `esp`, and `eip` out of |
| 35 //! sync with the other registers. Both the 32-bit x86 and 64-bit x86_64 |
| 36 //! versions of `RtlCaptureContext()` capture only the state of the integer |
| 37 //! registers, ignoring floating-point and vector state. |
| 38 //! |
| 39 //! \param[out] context The structure to store the context in. |
| 40 //! |
| 41 //! \note On x86_64, the value for `rcx` will be populated with the address of |
| 42 //! this function’s argument, as mandated by the ABI. |
| 43 void CaptureContext(CONTEXT* context); |
| 44 |
| 45 } // namespace crashpad |
| 46 |
| 47 #endif // CRASHPAD_CLIENT_CAPTURE_CONTEXT_WIN_H_ |
OLD | NEW |