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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 for (size_t target_type_index = 0; | 214 for (size_t target_type_index = 0; |
215 !success && target_type_index < arraysize(kTargetTypes); | 215 !success && target_type_index < arraysize(kTargetTypes); |
216 ++target_type_index) { | 216 ++target_type_index) { |
217 ExceptionPorts::ExceptionHandlerVector handlers; | 217 ExceptionPorts::ExceptionHandlerVector handlers; |
218 ExceptionPorts exception_ports(kTargetTypes[target_type_index], | 218 ExceptionPorts exception_ports(kTargetTypes[target_type_index], |
219 MACH_PORT_NULL); | 219 MACH_PORT_NULL); |
220 if (exception_ports.GetExceptionPorts(EXC_MASK_CRASH, &handlers)) { | 220 if (exception_ports.GetExceptionPorts(EXC_MASK_CRASH, &handlers)) { |
221 DCHECK_LE(handlers.size(), 1u); | 221 DCHECK_LE(handlers.size(), 1u); |
222 if (handlers.size() == 1) { | 222 if (handlers.size() == 1) { |
223 DCHECK(handlers[0].mask & EXC_MASK_CRASH); | 223 DCHECK(handlers[0].mask & EXC_MASK_CRASH); |
224 success = DeliverException(thread, | 224 success = DeliverException(thread.get(), |
225 mach_task_self(), | 225 mach_task_self(), |
226 exception, | 226 exception, |
227 codes, | 227 codes, |
228 code_count, | 228 code_count, |
229 cpu_context, | 229 cpu_context, |
230 handlers[0], | 230 handlers[0], |
231 false); | 231 false); |
232 } | 232 } |
233 } | 233 } |
234 } | 234 } |
235 | 235 |
236 LOG_IF(WARNING, !success) | 236 LOG_IF(WARNING, !success) |
237 << "SimulateCrash did not find an appropriate exception handler"; | 237 << "SimulateCrash did not find an appropriate exception handler"; |
238 } | 238 } |
239 | 239 |
240 } // namespace crashpad | 240 } // namespace crashpad |
OLD | NEW |