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

Side by Side Diff: handler/mac/crash_report_exception_handler.cc

Issue 1049023003: Add ExcServerCopyState() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 5 years, 8 months 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 | « client/simulate_crash_mac_test.cc ('k') | tools/mac/catch_exception_tool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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,
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 UUID uuid; 187 UUID uuid;
188 database_status = database_->FinishedWritingCrashReport(new_report, &uuid); 188 database_status = database_->FinishedWritingCrashReport(new_report, &uuid);
189 if (database_status != CrashReportDatabase::kNoError) { 189 if (database_status != CrashReportDatabase::kNoError) {
190 return KERN_FAILURE; 190 return KERN_FAILURE;
191 } 191 }
192 192
193 upload_thread_->ReportPending(); 193 upload_thread_->ReportPending();
194 } 194 }
195 195
196 bool forwarded = false;
196 if (client_options.system_crash_reporter_forwarding != TriState::kDisabled && 197 if (client_options.system_crash_reporter_forwarding != TriState::kDisabled &&
197 (exception == EXC_CRASH || 198 (exception == EXC_CRASH ||
198 exception == EXC_RESOURCE || 199 exception == EXC_RESOURCE ||
199 exception == EXC_GUARD)) { 200 exception == EXC_GUARD)) {
200 // Don’t forward simulated exceptions such as kMachExceptionSimulated to the 201 // Don’t forward simulated exceptions such as kMachExceptionSimulated to the
201 // system crash reporter. Only forward the types of exceptions that it would 202 // system crash reporter. Only forward the types of exceptions that it would
202 // receive under normal conditions. Although the system crash reporter is 203 // receive under normal conditions. Although the system crash reporter is
203 // able to deal with other exceptions including simulated ones, forwarding 204 // able to deal with other exceptions including simulated ones, forwarding
204 // them to the system crash reporter could present the system’s crash UI for 205 // them to the system crash reporter could present the system’s crash UI for
205 // processes that haven’t actually crashed, and could result in reports not 206 // processes that haven’t actually crashed, and could result in reports not
(...skipping 30 matching lines...) Expand all
236 thread, 237 thread,
237 task, 238 task,
238 exception, 239 exception,
239 code, 240 code,
240 code_count, 241 code_count,
241 &flavor_forward, 242 &flavor_forward,
242 old_state, 243 old_state,
243 old_state_count, 244 old_state_count,
244 new_state_forward_count ? &new_state_forward[0] : nullptr, 245 new_state_forward_count ? &new_state_forward[0] : nullptr,
245 &new_state_forward_count); 246 &new_state_forward_count);
246 MACH_LOG_IF(WARNING, kr != KERN_SUCCESS, kr) 247 if (kr == KERN_SUCCESS) {
247 << "UniversalExceptionRaise " << kSystemCrashReporterServiceName; 248 forwarded = true;
249 } else {
250 MACH_LOG(WARNING, kr)
251 << "UniversalExceptionRaise " << kSystemCrashReporterServiceName;
252 }
248 } 253 }
249 } 254 }
250 255
256 if (!forwarded) {
257 ExcServerCopyState(
258 behavior, old_state, old_state_count, new_state, new_state_count);
259 }
260
251 return ExcServerSuccessfulReturnValue(behavior, false); 261 return ExcServerSuccessfulReturnValue(behavior, false);
252 } 262 }
253 263
254 } // namespace crashpad 264 } // namespace crashpad
OLDNEW
« no previous file with comments | « client/simulate_crash_mac_test.cc ('k') | tools/mac/catch_exception_tool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698