| 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_SNAPSHOT_MAC_SNAPSHOT_CPU_CONTEXT_MAC_H_ | 15 #ifndef CRASHPAD_SNAPSHOT_MAC_SNAPSHOT_CPU_CONTEXT_MAC_H_ |
| 16 #define CRASHPAD_SNAPSHOT_MAC_SNAPSHOT_CPU_CONTEXT_MAC_H_ | 16 #define CRASHPAD_SNAPSHOT_MAC_SNAPSHOT_CPU_CONTEXT_MAC_H_ |
| 17 | 17 |
| 18 #include <mach/mach.h> | 18 #include <mach/mach.h> |
| 19 | 19 |
| 20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #include "snapshot/cpu_context.h" | 21 #include "snapshot/cpu_context.h" |
| 22 #include "util/mach/mach_extensions.h" | 22 #include "util/mach/mach_extensions.h" |
| 23 | 23 |
| 24 namespace crashpad { | 24 namespace crashpad { |
| 25 namespace internal { | 25 namespace internal { |
| 26 | 26 |
| 27 #if defined(ARCH_CPU_X86_FAMILY) || DOXYGEN | 27 #if defined(ARCH_CPU_X86_FAMILY) || DOXYGEN |
| 28 | 28 |
| 29 //! \brief Initializes a CPUContextX86 structure from native context structures | 29 //! \brief Initializes a CPUContextX86 structure from native context structures |
| 30 //! on Mac OS X. | 30 //! on macOS. |
| 31 //! | 31 //! |
| 32 //! \a flavor, \a state, and \a state_count may be supplied by exception | 32 //! \a flavor, \a state, and \a state_count may be supplied by exception |
| 33 //! handlers in order for the \a context parameter to be initialized by the | 33 //! handlers in order for the \a context parameter to be initialized by the |
| 34 //! thread state received by the exception handler to the extent possible. In | 34 //! thread state received by the exception handler to the extent possible. In |
| 35 //! that case, whatever thread state specified by these three parameters will | 35 //! that case, whatever thread state specified by these three parameters will |
| 36 //! supersede \a x86_thread_state32, \a x86_float_state32, or \a | 36 //! supersede \a x86_thread_state32, \a x86_float_state32, or \a |
| 37 //! x86_debug_state32. If thread state in this format is not available, \a | 37 //! x86_debug_state32. If thread state in this format is not available, \a |
| 38 //! flavor may be set to `THREAD_STATE_NONE`, and all of \a x86_thread_state32, | 38 //! flavor may be set to `THREAD_STATE_NONE`, and all of \a x86_thread_state32, |
| 39 //! \a x86_float_state32, and \a x86_debug_state32 will be honored. | 39 //! \a x86_float_state32, and \a x86_debug_state32 will be honored. |
| 40 //! | 40 //! |
| (...skipping 20 matching lines...) Expand all Loading... |
| 61 //! \param[in] x86_debug_state32 The state of the thread’s debug registers. | 61 //! \param[in] x86_debug_state32 The state of the thread’s debug registers. |
| 62 void InitializeCPUContextX86(CPUContextX86* context, | 62 void InitializeCPUContextX86(CPUContextX86* context, |
| 63 thread_state_flavor_t flavor, | 63 thread_state_flavor_t flavor, |
| 64 ConstThreadState state, | 64 ConstThreadState state, |
| 65 mach_msg_type_number_t state_count, | 65 mach_msg_type_number_t state_count, |
| 66 const x86_thread_state32_t* x86_thread_state32, | 66 const x86_thread_state32_t* x86_thread_state32, |
| 67 const x86_float_state32_t* x86_float_state32, | 67 const x86_float_state32_t* x86_float_state32, |
| 68 const x86_debug_state32_t* x86_debug_state32); | 68 const x86_debug_state32_t* x86_debug_state32); |
| 69 | 69 |
| 70 //! \brief Initializes a CPUContextX86_64 structure from native context | 70 //! \brief Initializes a CPUContextX86_64 structure from native context |
| 71 //! structures on Mac OS X. | 71 //! structures on macOS. |
| 72 //! | 72 //! |
| 73 //! \a flavor, \a state, and \a state_count may be supplied by exception | 73 //! \a flavor, \a state, and \a state_count may be supplied by exception |
| 74 //! handlers in order for the \a context parameter to be initialized by the | 74 //! handlers in order for the \a context parameter to be initialized by the |
| 75 //! thread state received by the exception handler to the extent possible. In | 75 //! thread state received by the exception handler to the extent possible. In |
| 76 //! that case, whatever thread state specified by these three parameters will | 76 //! that case, whatever thread state specified by these three parameters will |
| 77 //! supersede \a x86_thread_state64, \a x86_float_state64, or \a | 77 //! supersede \a x86_thread_state64, \a x86_float_state64, or \a |
| 78 //! x86_debug_state64. If thread state in this format is not available, \a | 78 //! x86_debug_state64. If thread state in this format is not available, \a |
| 79 //! flavor may be set to `THREAD_STATE_NONE`, and all of \a x86_thread_state64, | 79 //! flavor may be set to `THREAD_STATE_NONE`, and all of \a x86_thread_state64, |
| 80 //! \a x86_float_state64, and \a x86_debug_state64 will be honored. | 80 //! \a x86_float_state64, and \a x86_debug_state64 will be honored. |
| 81 //! | 81 //! |
| (...skipping 25 matching lines...) Expand all Loading... |
| 107 const x86_thread_state64_t* x86_thread_state64, | 107 const x86_thread_state64_t* x86_thread_state64, |
| 108 const x86_float_state64_t* x86_float_state64, | 108 const x86_float_state64_t* x86_float_state64, |
| 109 const x86_debug_state64_t* x86_debug_state64); | 109 const x86_debug_state64_t* x86_debug_state64); |
| 110 | 110 |
| 111 #endif | 111 #endif |
| 112 | 112 |
| 113 } // namespace internal | 113 } // namespace internal |
| 114 } // namespace crashpad | 114 } // namespace crashpad |
| 115 | 115 |
| 116 #endif // CRASHPAD_SNAPSHOT_MAC_SNAPSHOT_CPU_CONTEXT_MAC_H_ | 116 #endif // CRASHPAD_SNAPSHOT_MAC_SNAPSHOT_CPU_CONTEXT_MAC_H_ |
| OLD | NEW |