From 30566abed8d95b752f31f67fde94c0ae0a1502d2 Mon Sep 17 00:00:00 2001 From: "benchan@chromium.org" Date: Thu, 19 Jan 2012 07:14:51 +0000 Subject: Implement core dump to minidump conversion. This patch is part of a bigger patch that helps merging the breakpad code with the modified version in Chromium OS. Specifically, this patch makes the following changes: 1. Turn the LinuxDumper class into a base class and move ptrace related code into a new derived class, LinuxPtraceDumper. 2. Add a LinuxCoreDumper class, which is derived from LinuxDumper, to extract information from a crashed process via a core dump file instead of ptrace. 3. Add a WriteMinidumpFromCore function to src/client/linux/minidump_writer/minidump_writer.h, which uses LinuxCoreDumper to extract information from a core dump file. 4. Add a core2md utility, which simply wraps WriteMinidumpFromCore, for converting a core dump to a minidump. BUG=455 TEST=Tested the following: 1. Build on 32-bit and 64-bit Linux with gcc 4.4.3 and gcc 4.6. 2. Build on Mac OS X 10.6.8 with gcc 4.2 and clang 3.0 (with latest gmock). 3. All unit tests pass. 4. Run Chromium OS tests to test core2md. Review URL: http://breakpad.appspot.com/343001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@905 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/linux/minidump_writer/minidump_writer.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/client/linux/minidump_writer/minidump_writer.h') diff --git a/src/client/linux/minidump_writer/minidump_writer.h b/src/client/linux/minidump_writer/minidump_writer.h index 156ca35f..731249e3 100644 --- a/src/client/linux/minidump_writer/minidump_writer.h +++ b/src/client/linux/minidump_writer/minidump_writer.h @@ -62,6 +62,12 @@ bool WriteMinidump(const char* filename, pid_t crashing_process, const void* blob, size_t blob_size, const MappingList& mappings); +// Write a minidump to the filesystem. Same as above, but uses the given +// core file and procfs directory to generate the minidump post mortem. +bool WriteMinidumpFromCore(const char* filename, + const char* core_path, + const char* procfs_override); + } // namespace google_breakpad #endif // CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_WRITER_H_ -- cgit v1.2.1