OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "crash-reporter/user_collector.h" | 5 #include "crash-reporter/user_collector.h" |
6 | 6 |
7 #include <grp.h> // For struct group. | 7 #include <grp.h> // For struct group. |
8 #include <pcrecpp.h> | 8 #include <pcrecpp.h> |
9 #include <pcrecpp.h> | 9 #include <pcrecpp.h> |
10 #include <pwd.h> // For struct passwd. | 10 #include <pwd.h> // For struct passwd. |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 // crashes towards user crashes, so user crashes really mean non-Chrome | 465 // crashes towards user crashes, so user crashes really mean non-Chrome |
466 // user-space crashes. | 466 // user-space crashes. |
467 if (exec == "chrome" || exec == "supplied_chrome") { | 467 if (exec == "chrome" || exec == "supplied_chrome") { |
468 feedback = false; | 468 feedback = false; |
469 handling_string = "ignoring - chrome crash"; | 469 handling_string = "ignoring - chrome crash"; |
470 } | 470 } |
471 | 471 |
472 logger_->LogWarning("Received crash notification for %s[%d] sig %d (%s)", | 472 logger_->LogWarning("Received crash notification for %s[%d] sig %d (%s)", |
473 exec.c_str(), pid, signal, handling_string); | 473 exec.c_str(), pid, signal, handling_string); |
474 | 474 |
| 475 // For developer builds, we always want to keep the crash reports unless |
| 476 // we're testing the crash facilities themselves. |
| 477 if (file_util::PathExists(FilePath(kLeaveCoreFile)) && |
| 478 !IsCrashTestInProgress()) { |
| 479 feedback = true; |
| 480 } |
| 481 |
475 if (feedback) { | 482 if (feedback) { |
476 count_crash_function_(); | 483 count_crash_function_(); |
477 | 484 |
478 if (generate_diagnostics_) { | 485 if (generate_diagnostics_) { |
479 bool out_of_capacity = false; | 486 bool out_of_capacity = false; |
480 bool convert_and_enqueue_result = | 487 bool convert_and_enqueue_result = |
481 ConvertAndEnqueueCrash(pid, exec, &out_of_capacity); | 488 ConvertAndEnqueueCrash(pid, exec, &out_of_capacity); |
482 if (!convert_and_enqueue_result) { | 489 if (!convert_and_enqueue_result) { |
483 if (!out_of_capacity) | 490 if (!out_of_capacity) |
484 EnqueueCollectionErrorLog(pid, exec); | 491 EnqueueCollectionErrorLog(pid, exec); |
485 return false; | 492 return false; |
486 } | 493 } |
487 } | 494 } |
488 } | 495 } |
489 | 496 |
490 return true; | 497 return true; |
491 } | 498 } |
OLD | NEW |