| OLD | NEW |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 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, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. | 13 // limitations under the License. |
| 14 | 14 |
| 15 #include <stdlib.h> | 15 #include <stdlib.h> |
| 16 #include <windows.h> | 16 #include <windows.h> |
| 17 | 17 |
| 18 #include "base/files/file_path.h" | 18 #include "base/files/file_path.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #include "client/crashpad_client.h" | 21 #include "client/crashpad_client.h" |
| 22 #include "test/paths.h" | 22 #include "test/paths.h" |
| 23 #include "tools/tool_support.h" | |
| 24 | 23 |
| 25 #if !defined(ARCH_CPU_X86) | 24 #if !defined(ARCH_CPU_X86) |
| 26 #error This test is only supported on x86. | 25 #error This test is only supported on x86. |
| 27 #endif // !ARCH_CPU_X86 | 26 #endif // !ARCH_CPU_X86 |
| 28 | 27 |
| 29 namespace crashpad { | 28 namespace crashpad { |
| 30 namespace { | 29 namespace { |
| 31 | 30 |
| 32 int CrashyLoadZ7Main(int argc, char* argv[]) { | 31 int CrashyLoadZ7Main(int argc, wchar_t* argv[]) { |
| 33 if (argc != 2) { | 32 if (argc != 2) { |
| 34 fprintf(stderr, "Usage: %s <server_pipe_name>\n", argv[0]); | 33 fprintf(stderr, "Usage: %ls <server_pipe_name>\n", argv[0]); |
| 35 return EXIT_FAILURE; | 34 return EXIT_FAILURE; |
| 36 } | 35 } |
| 37 | 36 |
| 38 CrashpadClient client; | 37 CrashpadClient client; |
| 39 if (!client.SetHandler(argv[1])) { | 38 if (!client.SetHandlerIPCPipe(argv[1])) { |
| 40 LOG(ERROR) << "SetHandler"; | 39 LOG(ERROR) << "SetHandler"; |
| 41 return EXIT_FAILURE; | 40 return EXIT_FAILURE; |
| 42 } | 41 } |
| 43 if (!client.UseHandler()) { | 42 if (!client.UseHandler()) { |
| 44 LOG(ERROR) << "UseHandler"; | 43 LOG(ERROR) << "UseHandler"; |
| 45 return EXIT_FAILURE; | 44 return EXIT_FAILURE; |
| 46 } | 45 } |
| 47 | 46 |
| 48 // The DLL has /Z7 symbols embedded in the binary (rather than in a .pdb). | 47 // The DLL has /Z7 symbols embedded in the binary (rather than in a .pdb). |
| 49 // There's only an x86 version of this dll as newer x64 toolchains can't | 48 // There's only an x86 version of this dll as newer x64 toolchains can't |
| (...skipping 12 matching lines...) Expand all Loading... |
| 62 } | 61 } |
| 63 reinterpret_cast<void(*)()>(crash_me)(); | 62 reinterpret_cast<void(*)()>(crash_me)(); |
| 64 | 63 |
| 65 return EXIT_SUCCESS; | 64 return EXIT_SUCCESS; |
| 66 } | 65 } |
| 67 | 66 |
| 68 } // namespace | 67 } // namespace |
| 69 } // namespace crashpad | 68 } // namespace crashpad |
| 70 | 69 |
| 71 int wmain(int argc, wchar_t* argv[]) { | 70 int wmain(int argc, wchar_t* argv[]) { |
| 72 return crashpad::ToolSupport::Wmain(argc, argv, crashpad::CrashyLoadZ7Main); | 71 return crashpad::CrashyLoadZ7Main(argc, argv); |
| 73 } | 72 } |
| OLD | NEW |