| 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 27 matching lines...) Expand all Loading... |
| 38 //! This function returns normally after the exception message is processed. If | 38 //! This function returns normally after the exception message is processed. If |
| 39 //! no valid handler was found, or no handler processed the exception | 39 //! no valid handler was found, or no handler processed the exception |
| 40 //! successfully, a warning will be logged, but these conditions are not | 40 //! successfully, a warning will be logged, but these conditions are not |
| 41 //! considered fatal. | 41 //! considered fatal. |
| 42 //! | 42 //! |
| 43 //! \param[in] cpu_context The thread state to pass to the exception handler as | 43 //! \param[in] cpu_context The thread state to pass to the exception handler as |
| 44 //! the exception context, provided that it is compatible with the thread | 44 //! the exception context, provided that it is compatible with the thread |
| 45 //! state flavor that the exception handler accepts. If it is not | 45 //! state flavor that the exception handler accepts. If it is not |
| 46 //! compatible, the correct thread state for the handler will be obtained by | 46 //! compatible, the correct thread state for the handler will be obtained by |
| 47 //! calling `thread_get_state()`. | 47 //! calling `thread_get_state()`. |
| 48 void SimulateCrash(const NativeCPUContext* cpu_context); | 48 void SimulateCrash(const NativeCPUContext& cpu_context); |
| 49 | 49 |
| 50 } // namespace crashpad | 50 } // namespace crashpad |
| 51 | 51 |
| 52 //! \brief Captures the CPU context and simulates an exception without crashing. | 52 //! \brief Captures the CPU context and simulates an exception without crashing. |
| 53 #define CRASHPAD_SIMULATE_CRASH() \ | 53 #define CRASHPAD_SIMULATE_CRASH() \ |
| 54 do { \ | 54 do { \ |
| 55 crashpad::NativeCPUContext cpu_context; \ | 55 crashpad::NativeCPUContext cpu_context; \ |
| 56 crashpad::CaptureContext(&cpu_context); \ | 56 crashpad::CaptureContext(&cpu_context); \ |
| 57 crashpad::SimulateCrash(&cpu_context); \ | 57 crashpad::SimulateCrash(cpu_context); \ |
| 58 } while (false) | 58 } while (false) |
| 59 | 59 |
| 60 #endif // CRASHPAD_CLIENT_SIMULATE_CRASH_MAC_H_ | 60 #endif // CRASHPAD_CLIENT_SIMULATE_CRASH_MAC_H_ |
| OLD | NEW |