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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 //! \param[in] mask The exception mask, containing the `EXC_MASK_*` values to | 110 //! \param[in] mask The exception mask, containing the `EXC_MASK_*` values to |
111 //! be looked up and returned in \a handlers. | 111 //! be looked up and returned in \a handlers. |
112 //! \param[out] handlers The exception handlers registered for \a target_port | 112 //! \param[out] handlers The exception handlers registered for \a target_port |
113 //! to handle exceptions indicated in \a mask. The caller must take | 113 //! to handle exceptions indicated in \a mask. The caller must take |
114 //! ownership of the \a port members of the returned ExceptionHandler | 114 //! ownership of the \a port members of the returned ExceptionHandler |
115 //! objects. On failure, this argument is untouched. | 115 //! objects. On failure, this argument is untouched. |
116 //! | 116 //! |
117 //! \return `true` if `*_get_exception_ports()` returned `KERN_SUCCESS`, with | 117 //! \return `true` if `*_get_exception_ports()` returned `KERN_SUCCESS`, with |
118 //! \a handlers set appropriately. `false` otherwise, with an appropriate | 118 //! \a handlers set appropriately. `false` otherwise, with an appropriate |
119 //! message logged. | 119 //! message logged. |
120 //! | |
121 //! \note One element at most will be returned in \a handlers for each bit set | |
122 //! in \a mask. If no exception port is registered for a bit in \a mask, | |
123 //! there will either be no entry corresponding to that bit in \a | |
124 //! handlers, or there will be an entry whose ExceptionHandler::port field | |
125 //! is set to `MACH_PORT_NULL`. The precise behavior depends on the | |
Robert Sesek
2014/09/22 15:08:23
Would it not be better to have ExceptionPorts norm
| |
126 //! underlying operating system and the target type. | |
120 bool GetExceptionPorts(exception_mask_t mask, | 127 bool GetExceptionPorts(exception_mask_t mask, |
121 std::vector<ExceptionHandler>* handlers) const; | 128 std::vector<ExceptionHandler>* handlers) const; |
122 | 129 |
123 //! \brief Calls `*_set_exception_ports()` on the target. | 130 //! \brief Calls `*_set_exception_ports()` on the target. |
124 //! | 131 //! |
125 //! \param[in] mask A mask specifying the exception types to direct to \a | 132 //! \param[in] mask A mask specifying the exception types to direct to \a |
126 //! port, containing `EXC_MASK_*` values. | 133 //! port, containing `EXC_MASK_*` values. |
127 //! \param[in] port A send right to a Mach port that will handle exceptions | 134 //! \param[in] port A send right to a Mach port that will handle exceptions |
128 //! sustained by \a target_port of the types indicated in \a mask. The | 135 //! sustained by \a target_port of the types indicated in \a mask. The |
129 //! send right is copied, not consumed, by this call. | 136 //! send right is copied, not consumed, by this call. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 // even with a MACH_PORT_NULL target_port, because it is incorrect to | 180 // even with a MACH_PORT_NULL target_port, because it is incorrect to |
174 // deallocate the result of mach_task_self(). | 181 // deallocate the result of mach_task_self(). |
175 bool dealloc_target_port_; | 182 bool dealloc_target_port_; |
176 | 183 |
177 DISALLOW_COPY_AND_ASSIGN(ExceptionPorts); | 184 DISALLOW_COPY_AND_ASSIGN(ExceptionPorts); |
178 }; | 185 }; |
179 | 186 |
180 } // namespace crashpad | 187 } // namespace crashpad |
181 | 188 |
182 #endif // CRASHPAD_UTIL_MACH_EXCEPTION_PORTS_H_ | 189 #endif // CRASHPAD_UTIL_MACH_EXCEPTION_PORTS_H_ |
OLD | NEW |