| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 kern_return_t kr; | 64 kern_return_t kr; |
| 65 | 65 |
| 66 bool handler_wants_state = ExceptionBehaviorHasState(handler.behavior); | 66 bool handler_wants_state = ExceptionBehaviorHasState(handler.behavior); |
| 67 if (!handler_wants_state) { | 67 if (!handler_wants_state) { |
| 68 // Regardless of the passed-in value of |set_state|, if the handler won’t be | 68 // Regardless of the passed-in value of |set_state|, if the handler won’t be |
| 69 // dealing with any state at all, no state should be set. | 69 // dealing with any state at all, no state should be set. |
| 70 set_state = false; | 70 set_state = false; |
| 71 } | 71 } |
| 72 | 72 |
| 73 // A const version of thread_state_t. | 73 // A const version of thread_state_t. |
| 74 typedef const natural_t* ConstThreadState; | 74 using ConstThreadState = const natural_t*; |
| 75 | 75 |
| 76 // old_state is only used if the context already captured doesn’t match (or | 76 // old_state is only used if the context already captured doesn’t match (or |
| 77 // can’t be converted to) what’s registered for the handler. | 77 // can’t be converted to) what’s registered for the handler. |
| 78 thread_state_data_t old_state; | 78 thread_state_data_t old_state; |
| 79 | 79 |
| 80 thread_state_flavor_t flavor = handler.flavor; | 80 thread_state_flavor_t flavor = handler.flavor; |
| 81 ConstThreadState state; | 81 ConstThreadState state; |
| 82 mach_msg_type_number_t state_count; | 82 mach_msg_type_number_t state_count; |
| 83 switch (flavor) { | 83 switch (flavor) { |
| 84 #if defined(ARCH_CPU_X86_FAMILY) | 84 #if defined(ARCH_CPU_X86_FAMILY) |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 false); | 235 false); |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 } | 238 } |
| 239 | 239 |
| 240 LOG_IF(WARNING, !success) | 240 LOG_IF(WARNING, !success) |
| 241 << "SimulateCrash did not find an appropriate exception handler"; | 241 << "SimulateCrash did not find an appropriate exception handler"; |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace crashpad | 244 } // namespace crashpad |
| OLD | NEW |