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 29 matching lines...) Expand all Loading... |
40 // exception_type_t, it’s reasonable to assume that there cannot be any | 40 // exception_type_t, it’s reasonable to assume that there cannot be any |
41 // officially-defined exception_type_t values higher than 31. | 41 // officially-defined exception_type_t values higher than 31. |
42 // kMachExceptionSimulated uses a value well outside this range because it does | 42 // kMachExceptionSimulated uses a value well outside this range because it does |
43 // not require a corresponding mask value. Simulated exceptions are delivered to | 43 // not require a corresponding mask value. Simulated exceptions are delivered to |
44 // the exception handler registered for EXC_CRASH exceptions using | 44 // the exception handler registered for EXC_CRASH exceptions using |
45 // EXC_MASK_CRASH. | 45 // EXC_MASK_CRASH. |
46 | 46 |
47 //! \brief An exception type to use for simulated exceptions. | 47 //! \brief An exception type to use for simulated exceptions. |
48 const exception_type_t kMachExceptionSimulated = 'CPsx'; | 48 const exception_type_t kMachExceptionSimulated = 'CPsx'; |
49 | 49 |
| 50 //! \brief A const version of `thread_state_t`. |
| 51 //! |
| 52 //! This is useful as the \a old_state parameter to exception handler functions. |
| 53 //! Normally, these parameters are of type `thread_state_t`, but this allows |
| 54 //! modification of the state, which is conceptually `const`. |
| 55 using ConstThreadState = const natural_t*; |
| 56 |
50 //! \brief Like `mach_thread_self()`, but without the obligation to release the | 57 //! \brief Like `mach_thread_self()`, but without the obligation to release the |
51 //! send right. | 58 //! send right. |
52 //! | 59 //! |
53 //! `mach_thread_self()` returns a send right to the current thread port, | 60 //! `mach_thread_self()` returns a send right to the current thread port, |
54 //! incrementing its reference count. This burdens the caller with maintaining | 61 //! incrementing its reference count. This burdens the caller with maintaining |
55 //! this send right, and calling `mach_port_deallocate()` when it is no longer | 62 //! this send right, and calling `mach_port_deallocate()` when it is no longer |
56 //! needed. This is burdensome, and is at odds with the normal operation of | 63 //! needed. This is burdensome, and is at odds with the normal operation of |
57 //! `mach_task_self()`, which does not increment the task port’s reference count | 64 //! `mach_task_self()`, which does not increment the task port’s reference count |
58 //! whose result must not be deallocated. | 65 //! whose result must not be deallocated. |
59 //! | 66 //! |
(...skipping 28 matching lines...) Expand all Loading... |
88 //! appropriate for the system at run time. | 95 //! appropriate for the system at run time. |
89 //! | 96 //! |
90 //! \note `EXC_MASK_ALL` does not include the value of `EXC_MASK_CRASH`. | 97 //! \note `EXC_MASK_ALL` does not include the value of `EXC_MASK_CRASH`. |
91 //! Consumers that want `EXC_MASK_ALL` along with `EXC_MASK_CRASH` must use | 98 //! Consumers that want `EXC_MASK_ALL` along with `EXC_MASK_CRASH` must use |
92 //! ExcMaskAll() | `EXC_MASK_CRASH` explicitly. | 99 //! ExcMaskAll() | `EXC_MASK_CRASH` explicitly. |
93 exception_mask_t ExcMaskAll(); | 100 exception_mask_t ExcMaskAll(); |
94 | 101 |
95 } // namespace crashpad | 102 } // namespace crashpad |
96 | 103 |
97 #endif // CRASHPAD_UTIL_MACH_MACH_EXTENSIONS_H_ | 104 #endif // CRASHPAD_UTIL_MACH_MACH_EXTENSIONS_H_ |
OLD | NEW |