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 | 23 |
23 namespace crashpad { | 24 namespace crashpad { |
24 namespace internal { | 25 namespace internal { |
25 | 26 |
26 #if defined(ARCH_CPU_X86_FAMILY) || DOXYGEN | 27 #if defined(ARCH_CPU_X86_FAMILY) || DOXYGEN |
27 | 28 |
28 //! \brief Initializes a CPUContextX86 structure from native context structures | 29 //! \brief Initializes a CPUContextX86 structure from native context structures |
29 //! on Mac OS X. | 30 //! on Mac OS X. |
30 //! | 31 //! |
31 //! \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 |
(...skipping 21 matching lines...) Expand all Loading... |
53 //! flavor must be `THREAD_STATE_NONE`. If a “universal” structure is used, | 54 //! flavor must be `THREAD_STATE_NONE`. If a “universal” structure is used, |
54 //! it must carry 32-bit state data of the correct type. | 55 //! it must carry 32-bit state data of the correct type. |
55 //! \param[in] state_count The number of `natural_t`-sized (`int`-sized) units | 56 //! \param[in] state_count The number of `natural_t`-sized (`int`-sized) units |
56 //! in \a state. This may be 0 if \a state is `nullptr`. | 57 //! in \a state. This may be 0 if \a state is `nullptr`. |
57 //! \param[in] x86_thread_state32 The state of the thread’s integer registers. | 58 //! \param[in] x86_thread_state32 The state of the thread’s integer registers. |
58 //! \param[in] x86_float_state32 The state of the thread’s floating-point | 59 //! \param[in] x86_float_state32 The state of the thread’s floating-point |
59 //! registers. | 60 //! registers. |
60 //! \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. |
61 void InitializeCPUContextX86(CPUContextX86* context, | 62 void InitializeCPUContextX86(CPUContextX86* context, |
62 thread_state_flavor_t flavor, | 63 thread_state_flavor_t flavor, |
63 const natural_t* state, | 64 ConstThreadState state, |
64 mach_msg_type_number_t state_count, | 65 mach_msg_type_number_t state_count, |
65 const x86_thread_state32_t* x86_thread_state32, | 66 const x86_thread_state32_t* x86_thread_state32, |
66 const x86_float_state32_t* x86_float_state32, | 67 const x86_float_state32_t* x86_float_state32, |
67 const x86_debug_state32_t* x86_debug_state32); | 68 const x86_debug_state32_t* x86_debug_state32); |
68 | 69 |
69 //! \brief Initializes a CPUContextX86_64 structure from native context | 70 //! \brief Initializes a CPUContextX86_64 structure from native context |
70 //! structures on Mac OS X. | 71 //! structures on Mac OS X. |
71 //! | 72 //! |
72 //! \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 |
73 //! 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 |
(...skipping 20 matching lines...) Expand all Loading... |
94 //! flavor must be `THREAD_STATE_NONE`. If a “universal” structure is used, | 95 //! flavor must be `THREAD_STATE_NONE`. If a “universal” structure is used, |
95 //! it must carry 64-bit state data of the correct type. | 96 //! it must carry 64-bit state data of the correct type. |
96 //! \param[in] state_count The number of `int`-sized units in \a state. This may | 97 //! \param[in] state_count The number of `int`-sized units in \a state. This may |
97 //! be 0 if \a state is `nullptr`. | 98 //! be 0 if \a state is `nullptr`. |
98 //! \param[in] x86_thread_state64 The state of the thread’s integer registers. | 99 //! \param[in] x86_thread_state64 The state of the thread’s integer registers. |
99 //! \param[in] x86_float_state64 The state of the thread’s floating-point | 100 //! \param[in] x86_float_state64 The state of the thread’s floating-point |
100 //! registers. | 101 //! registers. |
101 //! \param[in] x86_debug_state64 The state of the thread’s debug registers. | 102 //! \param[in] x86_debug_state64 The state of the thread’s debug registers. |
102 void InitializeCPUContextX86_64(CPUContextX86_64* context, | 103 void InitializeCPUContextX86_64(CPUContextX86_64* context, |
103 thread_state_flavor_t flavor, | 104 thread_state_flavor_t flavor, |
104 const natural_t* state, | 105 ConstThreadState state, |
105 mach_msg_type_number_t state_count, | 106 mach_msg_type_number_t state_count, |
106 const x86_thread_state64_t* x86_thread_state64, | 107 const x86_thread_state64_t* x86_thread_state64, |
107 const x86_float_state64_t* x86_float_state64, | 108 const x86_float_state64_t* x86_float_state64, |
108 const x86_debug_state64_t* x86_debug_state64); | 109 const x86_debug_state64_t* x86_debug_state64); |
109 | 110 |
110 #endif | 111 #endif |
111 | 112 |
112 } // namespace internal | 113 } // namespace internal |
113 } // namespace crashpad | 114 } // namespace crashpad |
114 | 115 |
115 #endif // CRASHPAD_SNAPSHOT_MAC_SNAPSHOT_CPU_CONTEXT_MAC_H_ | 116 #endif // CRASHPAD_SNAPSHOT_MAC_SNAPSHOT_CPU_CONTEXT_MAC_H_ |
OLD | NEW |