linux: Put crash dumps under "/tmp/ProductName Crashes/"
This commit is contained in:
parent
739c432c98
commit
f13d8407ee
3 changed files with 7 additions and 8 deletions
|
@ -12,9 +12,9 @@
|
||||||
|
|
||||||
#include "base/debug/crash_logging.h"
|
#include "base/debug/crash_logging.h"
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
|
#include "base/files/file_util.h"
|
||||||
#include "base/linux_util.h"
|
#include "base/linux_util.h"
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/path_service.h"
|
|
||||||
#include "base/process/memory.h"
|
#include "base/process/memory.h"
|
||||||
#include "base/memory/singleton.h"
|
#include "base/memory/singleton.h"
|
||||||
#include "vendor/breakpad/src/client/linux/handler/exception_handler.h"
|
#include "vendor/breakpad/src/client/linux/handler/exception_handler.h"
|
||||||
|
@ -61,7 +61,7 @@ void CrashReporterLinux::InitBreakpad(const std::string& product_name,
|
||||||
const std::string& submit_url,
|
const std::string& submit_url,
|
||||||
bool auto_submit,
|
bool auto_submit,
|
||||||
bool skip_system_crash_handler) {
|
bool skip_system_crash_handler) {
|
||||||
EnableCrashDumping();
|
EnableCrashDumping(product_name);
|
||||||
|
|
||||||
crash_keys_.SetKeyValue("prod", "Atom-Shell");
|
crash_keys_.SetKeyValue("prod", "Atom-Shell");
|
||||||
crash_keys_.SetKeyValue("ver", version.c_str());
|
crash_keys_.SetKeyValue("ver", version.c_str());
|
||||||
|
@ -76,11 +76,11 @@ void CrashReporterLinux::SetUploadParameters() {
|
||||||
upload_parameters_["platform"] = "linux";
|
upload_parameters_["platform"] = "linux";
|
||||||
}
|
}
|
||||||
|
|
||||||
void CrashReporterLinux::EnableCrashDumping() {
|
void CrashReporterLinux::EnableCrashDumping(const std::string& product_name) {
|
||||||
base::FilePath tmp_path("/tmp");
|
std::string dump_dir = "/tmp/" + product_name + " Crashes";
|
||||||
PathService::Get(base::DIR_TEMP, &tmp_path);
|
base::FilePath dumps_path(dump_dir);
|
||||||
|
base::CreateDirectory(dumps_path);
|
||||||
|
|
||||||
base::FilePath dumps_path(tmp_path);
|
|
||||||
MinidumpDescriptor minidump_descriptor(dumps_path.value());
|
MinidumpDescriptor minidump_descriptor(dumps_path.value());
|
||||||
minidump_descriptor.set_size_limit(kMaxMinidumpFileSize);
|
minidump_descriptor.set_size_limit(kMaxMinidumpFileSize);
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ class CrashReporterLinux : public CrashReporter {
|
||||||
CrashReporterLinux();
|
CrashReporterLinux();
|
||||||
virtual ~CrashReporterLinux();
|
virtual ~CrashReporterLinux();
|
||||||
|
|
||||||
void EnableCrashDumping();
|
void EnableCrashDumping(const std::string& product_name);
|
||||||
|
|
||||||
static bool CrashDone(const google_breakpad::MinidumpDescriptor& minidump,
|
static bool CrashDone(const google_breakpad::MinidumpDescriptor& minidump,
|
||||||
void* context,
|
void* context,
|
||||||
|
|
|
@ -414,7 +414,6 @@ bool IsValidCrashReportId(const char* buf, size_t bytes_read,
|
||||||
// |buf| should be |expected_len| + 1 characters in size and NULL terminated.
|
// |buf| should be |expected_len| + 1 characters in size and NULL terminated.
|
||||||
void HandleCrashReportId(const char* buf, size_t bytes_read,
|
void HandleCrashReportId(const char* buf, size_t bytes_read,
|
||||||
size_t expected_len) {
|
size_t expected_len) {
|
||||||
WriteNewline();
|
|
||||||
if (!IsValidCrashReportId(buf, bytes_read, expected_len)) {
|
if (!IsValidCrashReportId(buf, bytes_read, expected_len)) {
|
||||||
static const char msg[] = "Failed to get crash dump id.";
|
static const char msg[] = "Failed to get crash dump id.";
|
||||||
WriteLog(msg, sizeof(msg) - 1);
|
WriteLog(msg, sizeof(msg) - 1);
|
||||||
|
|
Loading…
Reference in a new issue