| 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 19 matching lines...) Expand all Loading... |
| 30 #include "client/simple_string_dictionary.h" | 30 #include "client/simple_string_dictionary.h" |
| 31 #include "gtest/gtest.h" | 31 #include "gtest/gtest.h" |
| 32 #include "snapshot/mac/process_reader.h" | 32 #include "snapshot/mac/process_reader.h" |
| 33 #include "test/errors.h" | 33 #include "test/errors.h" |
| 34 #include "test/mac/mach_errors.h" | 34 #include "test/mac/mach_errors.h" |
| 35 #include "test/mac/mach_multiprocess.h" | 35 #include "test/mac/mach_multiprocess.h" |
| 36 #include "util/file/file_io.h" | 36 #include "util/file/file_io.h" |
| 37 #include "util/mac/mac_util.h" | 37 #include "util/mac/mac_util.h" |
| 38 #include "util/mach/exc_server_variants.h" | 38 #include "util/mach/exc_server_variants.h" |
| 39 #include "util/mach/exception_ports.h" | 39 #include "util/mach/exception_ports.h" |
| 40 #include "util/mach/mach_extensions.h" |
| 40 #include "util/mach/mach_message.h" | 41 #include "util/mach/mach_message.h" |
| 41 #include "util/mach/mach_message_server.h" | 42 #include "util/mach/mach_message_server.h" |
| 42 | 43 |
| 43 namespace crashpad { | 44 namespace crashpad { |
| 44 namespace test { | 45 namespace test { |
| 45 namespace { | 46 namespace { |
| 46 | 47 |
| 47 class TestMachOImageAnnotationsReader final | 48 class TestMachOImageAnnotationsReader final |
| 48 : public MachMultiprocess, | 49 : public MachMultiprocess, |
| 49 public UniversalMachExcServer::Interface { | 50 public UniversalMachExcServer::Interface { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 72 | 73 |
| 73 // UniversalMachExcServer::Interface: | 74 // UniversalMachExcServer::Interface: |
| 74 kern_return_t CatchMachException(exception_behavior_t behavior, | 75 kern_return_t CatchMachException(exception_behavior_t behavior, |
| 75 exception_handler_t exception_port, | 76 exception_handler_t exception_port, |
| 76 thread_t thread, | 77 thread_t thread, |
| 77 task_t task, | 78 task_t task, |
| 78 exception_type_t exception, | 79 exception_type_t exception, |
| 79 const mach_exception_data_type_t* code, | 80 const mach_exception_data_type_t* code, |
| 80 mach_msg_type_number_t code_count, | 81 mach_msg_type_number_t code_count, |
| 81 thread_state_flavor_t* flavor, | 82 thread_state_flavor_t* flavor, |
| 82 const natural_t* old_state, | 83 ConstThreadState old_state, |
| 83 mach_msg_type_number_t old_state_count, | 84 mach_msg_type_number_t old_state_count, |
| 84 thread_state_t new_state, | 85 thread_state_t new_state, |
| 85 mach_msg_type_number_t* new_state_count, | 86 mach_msg_type_number_t* new_state_count, |
| 86 const mach_msg_trailer_t* trailer, | 87 const mach_msg_trailer_t* trailer, |
| 87 bool* destroy_complex_request) override { | 88 bool* destroy_complex_request) override { |
| 88 *destroy_complex_request = true; | 89 *destroy_complex_request = true; |
| 89 | 90 |
| 90 EXPECT_EQ(ChildTask(), task); | 91 EXPECT_EQ(ChildTask(), task); |
| 91 | 92 |
| 92 ProcessReader process_reader; | 93 ProcessReader process_reader; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 | 335 |
| 335 TEST(MachOImageAnnotationsReader, CrashDyld) { | 336 TEST(MachOImageAnnotationsReader, CrashDyld) { |
| 336 TestMachOImageAnnotationsReader test_mach_o_image_annotations_reader( | 337 TestMachOImageAnnotationsReader test_mach_o_image_annotations_reader( |
| 337 TestMachOImageAnnotationsReader::kCrashDyld); | 338 TestMachOImageAnnotationsReader::kCrashDyld); |
| 338 test_mach_o_image_annotations_reader.Run(); | 339 test_mach_o_image_annotations_reader.Run(); |
| 339 } | 340 } |
| 340 | 341 |
| 341 } // namespace | 342 } // namespace |
| 342 } // namespace test | 343 } // namespace test |
| 343 } // namespace crashpad | 344 } // namespace crashpad |
| OLD | NEW |