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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #include "base/basictypes.h" | 28 #include "base/basictypes.h" |
29 #include "client/crashpad_info.h" | 29 #include "client/crashpad_info.h" |
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 "util/file/fd_io.h" | 33 #include "util/file/fd_io.h" |
34 #include "util/mac/mac_util.h" | 34 #include "util/mac/mac_util.h" |
35 #include "util/mach/exc_server_variants.h" | 35 #include "util/mach/exc_server_variants.h" |
36 #include "util/mach/exception_ports.h" | 36 #include "util/mach/exception_ports.h" |
| 37 #include "util/mach/mach_message.h" |
37 #include "util/mach/mach_message_server.h" | 38 #include "util/mach/mach_message_server.h" |
38 #include "util/test/errors.h" | 39 #include "util/test/errors.h" |
39 #include "util/test/mac/mach_errors.h" | 40 #include "util/test/mac/mach_errors.h" |
40 #include "util/test/mac/mach_multiprocess.h" | 41 #include "util/test/mac/mach_multiprocess.h" |
41 | 42 |
42 namespace crashpad { | 43 namespace crashpad { |
43 namespace test { | 44 namespace test { |
44 namespace { | 45 namespace { |
45 | 46 |
46 class TestMachOImageAnnotationsReader final | 47 class TestMachOImageAnnotationsReader final |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 if (test_type_ != kDontCrash) { | 221 if (test_type_ != kDontCrash) { |
221 // Handle the child’s crash. Further validation will be done in | 222 // Handle the child’s crash. Further validation will be done in |
222 // CatchMachException(). | 223 // CatchMachException(). |
223 UniversalMachExcServer universal_mach_exc_server(this); | 224 UniversalMachExcServer universal_mach_exc_server(this); |
224 | 225 |
225 mach_msg_return_t mr = | 226 mach_msg_return_t mr = |
226 MachMessageServer::Run(&universal_mach_exc_server, | 227 MachMessageServer::Run(&universal_mach_exc_server, |
227 LocalPort(), | 228 LocalPort(), |
228 MACH_MSG_OPTION_NONE, | 229 MACH_MSG_OPTION_NONE, |
229 MachMessageServer::kOneShot, | 230 MachMessageServer::kOneShot, |
230 MachMessageServer::kBlocking, | |
231 MachMessageServer::kReceiveLargeError, | 231 MachMessageServer::kReceiveLargeError, |
232 MACH_MSG_TIMEOUT_NONE); | 232 kMachMessageTimeoutWaitIndefinitely); |
233 EXPECT_EQ(MACH_MSG_SUCCESS, mr) | 233 EXPECT_EQ(MACH_MSG_SUCCESS, mr) |
234 << MachErrorMessage(mr, "MachMessageServer::Run"); | 234 << MachErrorMessage(mr, "MachMessageServer::Run"); |
235 | 235 |
236 switch (test_type_) { | 236 switch (test_type_) { |
237 case kCrashAbort: | 237 case kCrashAbort: |
238 SetExpectedChildTermination(kTerminationSignal, SIGABRT); | 238 SetExpectedChildTermination(kTerminationSignal, SIGABRT); |
239 break; | 239 break; |
240 | 240 |
241 case kCrashDyld: | 241 case kCrashDyld: |
242 // dyld fatal errors result in the execution of an int3 instruction on | 242 // dyld fatal errors result in the execution of an int3 instruction on |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 TEST(MachOImageAnnotationsReader, CrashDyld) { | 331 TEST(MachOImageAnnotationsReader, CrashDyld) { |
332 TestMachOImageAnnotationsReader test_mach_o_image_annotations_reader( | 332 TestMachOImageAnnotationsReader test_mach_o_image_annotations_reader( |
333 TestMachOImageAnnotationsReader::kCrashDyld); | 333 TestMachOImageAnnotationsReader::kCrashDyld); |
334 test_mach_o_image_annotations_reader.Run(); | 334 test_mach_o_image_annotations_reader.Run(); |
335 } | 335 } |
336 | 336 |
337 } // namespace | 337 } // namespace |
338 } // namespace test | 338 } // namespace test |
339 } // namespace crashpad | 339 } // namespace crashpad |
OLD | NEW |