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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 sizeof(*out_reply) - sizeof(out_reply->new_state) + | 311 sizeof(*out_reply) - sizeof(out_reply->new_state) + |
312 sizeof(out_reply->new_state[0]) * out_reply->new_stateCnt; | 312 sizeof(out_reply->new_state[0]) * out_reply->new_stateCnt; |
313 return true; | 313 return true; |
314 } | 314 } |
315 } | 315 } |
316 | 316 |
317 SetMIGReplyError(out_header, MIG_BAD_ID); | 317 SetMIGReplyError(out_header, MIG_BAD_ID); |
318 return false; | 318 return false; |
319 } | 319 } |
320 | 320 |
| 321 std::set<mach_msg_id_t> ExcServer::MachMessageServerRequestIDs() { |
| 322 const mach_msg_id_t request_ids[] = { |
| 323 kMachMessageIDExceptionRaise, |
| 324 kMachMessageIDExceptionRaiseState, |
| 325 kMachMessageIDExceptionRaiseStateIdentity |
| 326 }; |
| 327 return std::set<mach_msg_id_t>( |
| 328 &request_ids[0], &request_ids[arraysize(request_ids)]); |
| 329 } |
| 330 |
321 mach_msg_size_t ExcServer::MachMessageServerRequestSize() { | 331 mach_msg_size_t ExcServer::MachMessageServerRequestSize() { |
322 return sizeof(__RequestUnion__exc_subsystem); | 332 return sizeof(__RequestUnion__exc_subsystem); |
323 } | 333 } |
324 | 334 |
325 mach_msg_size_t ExcServer::MachMessageServerReplySize() { | 335 mach_msg_size_t ExcServer::MachMessageServerReplySize() { |
326 return sizeof(__ReplyUnion__exc_subsystem); | 336 return sizeof(__ReplyUnion__exc_subsystem); |
327 } | 337 } |
328 | 338 |
329 MachExcServer::MachExcServer(MachExcServer::Interface* interface) | 339 MachExcServer::MachExcServer(MachExcServer::Interface* interface) |
330 : MachMessageServer::Interface(), | 340 : MachMessageServer::Interface(), |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 sizeof(*out_reply) - sizeof(out_reply->new_state) + | 462 sizeof(*out_reply) - sizeof(out_reply->new_state) + |
453 sizeof(out_reply->new_state[0]) * out_reply->new_stateCnt; | 463 sizeof(out_reply->new_state[0]) * out_reply->new_stateCnt; |
454 return true; | 464 return true; |
455 } | 465 } |
456 } | 466 } |
457 | 467 |
458 SetMIGReplyError(out_header, MIG_BAD_ID); | 468 SetMIGReplyError(out_header, MIG_BAD_ID); |
459 return false; | 469 return false; |
460 } | 470 } |
461 | 471 |
| 472 std::set<mach_msg_id_t> MachExcServer::MachMessageServerRequestIDs() { |
| 473 const mach_msg_id_t request_ids[] = { |
| 474 kMachMessageIDMachExceptionRaise, |
| 475 kMachMessageIDMachExceptionRaiseState, |
| 476 kMachMessageIDMachExceptionRaiseStateIdentity |
| 477 }; |
| 478 return std::set<mach_msg_id_t>( |
| 479 &request_ids[0], &request_ids[arraysize(request_ids)]); |
| 480 } |
| 481 |
462 mach_msg_size_t MachExcServer::MachMessageServerRequestSize() { | 482 mach_msg_size_t MachExcServer::MachMessageServerRequestSize() { |
463 return sizeof(__RequestUnion__mach_exc_subsystem); | 483 return sizeof(__RequestUnion__mach_exc_subsystem); |
464 } | 484 } |
465 | 485 |
466 mach_msg_size_t MachExcServer::MachMessageServerReplySize() { | 486 mach_msg_size_t MachExcServer::MachMessageServerReplySize() { |
467 return sizeof(__ReplyUnion__mach_exc_subsystem); | 487 return sizeof(__ReplyUnion__mach_exc_subsystem); |
468 } | 488 } |
469 | 489 |
470 SimplifiedExcServer::SimplifiedExcServer( | 490 SimplifiedExcServer::SimplifiedExcServer( |
471 SimplifiedExcServer::Interface* interface) | 491 SimplifiedExcServer::Interface* interface) |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 in_header, out_header, destroy_complex_request); | 702 in_header, out_header, destroy_complex_request); |
683 } | 703 } |
684 | 704 |
685 // Do what the MIG-generated server routines do when they can’t dispatch a | 705 // Do what the MIG-generated server routines do when they can’t dispatch a |
686 // message. | 706 // message. |
687 PrepareMIGReplyFromRequest(in_header, out_header); | 707 PrepareMIGReplyFromRequest(in_header, out_header); |
688 SetMIGReplyError(out_header, MIG_BAD_ID); | 708 SetMIGReplyError(out_header, MIG_BAD_ID); |
689 return false; | 709 return false; |
690 } | 710 } |
691 | 711 |
| 712 std::set<mach_msg_id_t> UniversalMachExcServer::MachMessageServerRequestIDs() { |
| 713 std::set<mach_msg_id_t> request_ids = |
| 714 exc_server_.MachMessageServerRequestIDs(); |
| 715 |
| 716 std::set<mach_msg_id_t> mach_exc_request_ids = |
| 717 mach_exc_server_.MachMessageServerRequestIDs(); |
| 718 request_ids.insert(mach_exc_request_ids.begin(), mach_exc_request_ids.end()); |
| 719 |
| 720 return request_ids; |
| 721 } |
| 722 |
692 mach_msg_size_t UniversalMachExcServer::MachMessageServerRequestSize() { | 723 mach_msg_size_t UniversalMachExcServer::MachMessageServerRequestSize() { |
693 return std::max(mach_exc_server_.MachMessageServerRequestSize(), | 724 return std::max(mach_exc_server_.MachMessageServerRequestSize(), |
694 exc_server_.MachMessageServerRequestSize()); | 725 exc_server_.MachMessageServerRequestSize()); |
695 } | 726 } |
696 | 727 |
697 mach_msg_size_t UniversalMachExcServer::MachMessageServerReplySize() { | 728 mach_msg_size_t UniversalMachExcServer::MachMessageServerReplySize() { |
698 return std::max(mach_exc_server_.MachMessageServerReplySize(), | 729 return std::max(mach_exc_server_.MachMessageServerReplySize(), |
699 exc_server_.MachMessageServerReplySize()); | 730 exc_server_.MachMessageServerReplySize()); |
700 } | 731 } |
701 | 732 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 kern_return_t ExcServerSuccessfulReturnValue(exception_behavior_t behavior, | 828 kern_return_t ExcServerSuccessfulReturnValue(exception_behavior_t behavior, |
798 bool set_thread_state) { | 829 bool set_thread_state) { |
799 if (!set_thread_state && ExceptionBehaviorHasState(behavior)) { | 830 if (!set_thread_state && ExceptionBehaviorHasState(behavior)) { |
800 return MACH_RCV_PORT_DIED; | 831 return MACH_RCV_PORT_DIED; |
801 } | 832 } |
802 | 833 |
803 return KERN_SUCCESS; | 834 return KERN_SUCCESS; |
804 } | 835 } |
805 | 836 |
806 } // namespace crashpad | 837 } // namespace crashpad |
OLD | NEW |