Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: tools/mac/run_with_crashpad.cc

Issue 1413033007: mac: Restart crashpad_handler from the initial client if it dies (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: is_valid() Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « handler/win/crashy_test_program.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ToolSupport::UsageHint(me, "COMMAND is required"); 159 ToolSupport::UsageHint(me, "COMMAND is required");
160 return kExitFailure; 160 return kExitFailure;
161 } 161 }
162 162
163 // Start the handler process and direct exceptions to it. 163 // Start the handler process and direct exceptions to it.
164 CrashpadClient crashpad_client; 164 CrashpadClient crashpad_client;
165 if (!crashpad_client.StartHandler(base::FilePath(options.handler), 165 if (!crashpad_client.StartHandler(base::FilePath(options.handler),
166 base::FilePath(options.database), 166 base::FilePath(options.database),
167 options.url, 167 options.url,
168 options.annotations, 168 options.annotations,
169 options.arguments)) { 169 options.arguments,
170 false)) {
170 return kExitFailure; 171 return kExitFailure;
171 } 172 }
172 173
173 if (!crashpad_client.UseHandler()) { 174 if (!crashpad_client.UseHandler()) {
174 return kExitFailure; 175 return kExitFailure;
175 } 176 }
176 177
177 // Using the remaining arguments, start a new program with the new exception 178 // Using the remaining arguments, start a new program with the new exception
178 // port in effect. 179 // port in effect.
179 execvp(argv[0], argv); 180 execvp(argv[0], argv);
180 PLOG(ERROR) << "execvp " << argv[0]; 181 PLOG(ERROR) << "execvp " << argv[0];
181 return errno == ENOENT ? kExitExecENOENT : kExitExecFailure; 182 return errno == ENOENT ? kExitExecENOENT : kExitExecFailure;
182 } 183 }
183 184
184 } // namespace 185 } // namespace
185 } // namespace crashpad 186 } // namespace crashpad
186 187
187 int main(int argc, char* argv[]) { 188 int main(int argc, char* argv[]) {
188 return crashpad::RunWithCrashpadMain(argc, argv); 189 return crashpad::RunWithCrashpadMain(argc, argv);
189 } 190 }
OLDNEW
« no previous file with comments | « handler/win/crashy_test_program.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698