Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(36)

Issue 340001: Refactor LinuxDumper and MinidumpWriter. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 10 months ago by Ben Chan
Modified:
12 years, 10 months ago
CC:
google-breakpad-dev_googlegroups.com
Base URL:
http://google-breakpad.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Refactor LinuxDumper and MinidumpWriter.

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. Add two convenient methods, back() and empty(), to the wasteful_vector
   class.
2. Refactor the LinuxDumper class such that it can later be splitted into
   a base class and two derived classes, one uses the current ptrace
   implementation and one uses a core file.
3. Refactor the MinidumpWriter class such that it can later use different
   derived implementations of LinuxDumper.

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.

Patch Set 1 #

Total comments: 7

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M src/client/linux/minidump_writer/linux_dumper.cc View 8 chunks +22 lines, -14 lines 0 comments Download
M src/client/linux/minidump_writer/linux_dumper.h View 6 chunks +34 lines, -9 lines 0 comments Download
M src/client/linux/minidump_writer/linux_dumper_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/client/linux/minidump_writer/minidump_writer.cc View 1 2 23 chunks +71 lines, -64 lines 0 comments Download
M src/common/memory.h View 1 chunk +12 lines, -0 lines 0 comments Download
M src/common/memory_unittest.cc View 2 chunks +6 lines, -1 line 0 comments Download

Messages

Total messages: 4
Ben Chan
Instead making changes to LinuxDumper and splitting it into two derived classes in one big ...
12 years, 10 months ago #1
Ben Chan
http://breakpad.appspot.com/340001/diff/1/3 File src/client/linux/minidump_writer/linux_dumper.h (right): http://breakpad.appspot.com/340001/diff/1/3#newcode69 Line 69: #elif defined(__x86_64) Note: Just to make it consistent ...
12 years, 10 months ago #2
Lei Zhang (chromium)
LGTM with nits below http://breakpad.appspot.com/340001/diff/1/3 File src/client/linux/minidump_writer/linux_dumper.h (right): http://breakpad.appspot.com/340001/diff/1/3#newcode149 Line 149: void CopyFromProcess(void* dest, pid_t ...
12 years, 10 months ago #3
Ben Chan
12 years, 10 months ago #4
http://breakpad.appspot.com/340001/diff/1/3
File src/client/linux/minidump_writer/linux_dumper.h (right):

http://breakpad.appspot.com/340001/diff/1/3#newcode149
Line 149: void CopyFromProcess(void* dest, pid_t child, const void* src,
On 2012/01/11 01:23:41, thestig wrote:
> This can stay static since it doesn't access any member variables.

In case of core files, the derived implementation needs to access member
variables, so I made it a member method.

http://breakpad.appspot.com/340001/diff/1/5
File src/client/linux/minidump_writer/minidump_writer.cc (right):

http://breakpad.appspot.com/340001/diff/1/5#newcode1284
Line 1284: void* Alloc(unsigned bytes) {
On 2012/01/11 01:23:41, thestig wrote:
> nit: put this with GetCrashThread() ?

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted