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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 //! | 57 //! |
58 //! For convenience in implementation, these different “behaviors” of | 58 //! For convenience in implementation, these different “behaviors” of |
59 //! exception messages are all mapped to a single interface method. The | 59 //! exception messages are all mapped to a single interface method. The |
60 //! exception’s original “behavior” is specified in the \a behavior | 60 //! exception’s original “behavior” is specified in the \a behavior |
61 //! parameter. Only parameters that were supplied in the request message | 61 //! parameter. Only parameters that were supplied in the request message |
62 //! are populated, other parameters are set to reasonable default values. | 62 //! are populated, other parameters are set to reasonable default values. |
63 //! | 63 //! |
64 //! This behaves equivalently to a `catch_exception_raise_state_identity()` | 64 //! This behaves equivalently to a `catch_exception_raise_state_identity()` |
65 //! function used with `exc_server()`, or a | 65 //! function used with `exc_server()`, or a |
66 //! `catch_mach_exception_raise_state_identity()` function used with | 66 //! `catch_mach_exception_raise_state_identity()` function used with |
67 //! `mach_exc_server()`. The meanings of most parameters are identical to | 67 //! `mach_exc_server()`. Except as noted, the parameters and return value |
68 //! their meanings to these functions. | 68 //! are equivalent to those of these other functions. |
69 //! | 69 //! |
70 //! \param[in] behavior `EXCEPTION_DEFAULT`, `EXCEPTION_STATE`, | 70 //! \param[in] behavior `EXCEPTION_DEFAULT`, `EXCEPTION_STATE`, |
71 //! or `EXCEPTION_STATE_IDENTITY`, possibly with `MACH_EXCEPTION_CODES` | 71 //! or `EXCEPTION_STATE_IDENTITY`, possibly with `MACH_EXCEPTION_CODES` |
72 //! ORed in. This identifies which exception request message was | 72 //! ORed in. This identifies which exception request message was |
73 //! processed and thus which other parameters are valid. | 73 //! processed and thus which other parameters are valid. |
| 74 //! \param[in] exception_port |
| 75 //! \param[in] thread |
| 76 //! \param[in] task |
| 77 //! \param[in] exception |
| 78 //! \param[in] code |
| 79 //! \param[in] code_count |
| 80 //! \param[in,out] flavor |
| 81 //! \param[in] old_state |
| 82 //! \param[in] old_state_count |
| 83 //! \param[out] new_state |
| 84 //! \param[out] new_state_count |
74 //! \param[in] trailer The trailer received with the request message. | 85 //! \param[in] trailer The trailer received with the request message. |
75 //! \param[out] destroy_request `true` if the request message is to be | 86 //! \param[out] destroy_complex_request `true` if the request message is to |
76 //! destroyed even when this method returns success. See | 87 //! be destroyed even when this method returns success. See |
77 //! MachMessageServer::Interface. | 88 //! MachMessageServer::Interface. |
| 89 //! |
| 90 //! \return A code indicating whether the exception was handled. See |
| 91 //! ExcServerSuccessfulReturnValue() for success codes. On failure, |
| 92 //! a code such as `KERN_FAILURE`. |
78 virtual kern_return_t CatchMachException( | 93 virtual kern_return_t CatchMachException( |
79 exception_behavior_t behavior, | 94 exception_behavior_t behavior, |
80 exception_handler_t exception_port, | 95 exception_handler_t exception_port, |
81 thread_t thread, | 96 thread_t thread, |
82 task_t task, | 97 task_t task, |
83 exception_type_t exception, | 98 exception_type_t exception, |
84 const mach_exception_data_type_t* code, | 99 const mach_exception_data_type_t* code, |
85 mach_msg_type_number_t code_count, | 100 mach_msg_type_number_t code_count, |
86 thread_state_flavor_t* flavor, | 101 thread_state_flavor_t* flavor, |
87 ConstThreadState old_state, | 102 ConstThreadState old_state, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 //! from the \a old_state parameter of | 209 //! from the \a old_state parameter of |
195 //! internal::SimplifiedExcServer::Interface::CatchException(), for example. | 210 //! internal::SimplifiedExcServer::Interface::CatchException(), for example. |
196 //! \param[in] old_state_count The number of significant `natural_t` words in \a | 211 //! \param[in] old_state_count The number of significant `natural_t` words in \a |
197 //! old_state. This may be taken directly from the \a old_state_count | 212 //! old_state. This may be taken directly from the \a old_state_count |
198 //! parameter of internal::SimplifiedExcServer::Interface::CatchException(), | 213 //! parameter of internal::SimplifiedExcServer::Interface::CatchException(), |
199 //! for example. | 214 //! for example. |
200 //! \param[out] new_state The state value to be set. This may be taken directly | 215 //! \param[out] new_state The state value to be set. This may be taken directly |
201 //! from the \a new_state parameter of | 216 //! from the \a new_state parameter of |
202 //! internal::SimplifiedExcServer::Interface::CatchException(), for example. | 217 //! internal::SimplifiedExcServer::Interface::CatchException(), for example. |
203 //! This parameter is untouched if \a behavior is not state-carrying. | 218 //! This parameter is untouched if \a behavior is not state-carrying. |
204 //! \param[inout] new_state_count On entry, the number of `natural_t` words | 219 //! \param[in,out] new_state_count On entry, the number of `natural_t` words |
205 //! available to be written to in \a new_state. On return, the number of | 220 //! available to be written to in \a new_state. On return, the number of |
206 //! significant `natural_t` words in \a new_state. This may be taken | 221 //! significant `natural_t` words in \a new_state. This may be taken |
207 //! directly from the \a new_state_count parameter of | 222 //! directly from the \a new_state_count parameter of |
208 //! internal::SimplifiedExcServer::Interface::CatchException(), for example. | 223 //! internal::SimplifiedExcServer::Interface::CatchException(), for example. |
209 //! This parameter is untouched if \a behavior is not state-carrying. If \a | 224 //! This parameter is untouched if \a behavior is not state-carrying. If \a |
210 //! \a behavior is state-carrying, this parameter should be at least as | 225 //! \a behavior is state-carrying, this parameter should be at least as |
211 //! large as \a old_state_count. | 226 //! large as \a old_state_count. |
212 void ExcServerCopyState(exception_behavior_t behavior, | 227 void ExcServerCopyState(exception_behavior_t behavior, |
213 ConstThreadState old_state, | 228 ConstThreadState old_state, |
214 mach_msg_type_number_t old_state_count, | 229 mach_msg_type_number_t old_state_count, |
215 thread_state_t new_state, | 230 thread_state_t new_state, |
216 mach_msg_type_number_t* new_state_count); | 231 mach_msg_type_number_t* new_state_count); |
217 | 232 |
218 } // namespace crashpad | 233 } // namespace crashpad |
219 | 234 |
220 #endif // CRASHPAD_UTIL_MACH_EXC_SERVER_VARIANTS_H_ | 235 #endif // CRASHPAD_UTIL_MACH_EXC_SERVER_VARIANTS_H_ |
OLD | NEW |