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

Issue 241001: Allow MinidumpGenerator to dump processes of different CPU architecture (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 4 months ago by Ted Mielczarek
Modified:
13 years, 4 months ago
Reviewers:
Mark Mentovai
CC:
google-breakpad-dev_googlegroups.com
Visibility:
Public.

Description

This patch allows MinidumpGenerator to dump processes that are of a different
CPU architecture than the current process. This allows for dumping i386
processes from x86-64 processes running on the same system (and vice versa).

For Firefox 4, we're shipping a universal 32/64 binary, and running some
32-bit plugins out-of-process when running a 64-bit Firefox. We need 
these changes in order for crash reporting to work on the plugin processes.

This patch wound up being a lot larger than I expected, mostly due to all
the changes necessary in dynamic_images and having to mess with the
nlist implementation. Most of it is more refactoring than anything else,
just taking code that used to assume 32 or 64-bit mach structures based
on the current architecture and changing it to be templated and choosing
the structures based on the architecture of the process being dumped.

The CrossArchitectureDump test passes on my 10.6 system for both
x86-64 and i386 (if I flip the project settings to use the 10.6 SDK). I
don't have access to a 10.5 machine locally, so I don't know if it would
actually work on a 64-bit capable machine running 10.5, so I decided to
punt on it.

I don't have access to PPC hardware either, so I can't run the tests on
PPC. They fail under Rosetta, but they failed under Rosetta before my patch
anyway.

Patch Set 1 #

Total comments: 22

Patch Set 2 : Updated with review comments, portions rewritten #

Total comments: 43
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M src/client/mac/Breakpad.xcodeproj/project.pbxproj View 13 chunks +109 lines, -0 lines 0 comments Download
M src/client/mac/handler/breakpad_nlist_64.cc View 1 2 chunks +211 lines, -194 lines 21 comments Download
M src/client/mac/handler/breakpad_nlist_64.h View 1 chunk +10 lines, -4 lines 1 comment Download
M src/client/mac/handler/dynamic_images.cc View 1 3 chunks +285 lines, -217 lines 7 comments Download
M src/client/mac/handler/dynamic_images.h View 1 3 chunks +99 lines, -91 lines 0 comments Download
M src/client/mac/handler/minidump_generator.cc View 1 11 chunks +271 lines, -107 lines 8 comments Download
M src/client/mac/handler/minidump_generator.h View 2 chunks +30 lines, -22 lines 2 comments Download
M src/client/mac/tests/minidump_generator_test.cc View 3 chunks +160 lines, -1 line 3 comments Download
A src/client/mac/tests/minidump_generator_test_helper.cc View 1 chunk +64 lines, -0 lines 1 comment Download
M src/processor/minidump.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 7
Ted Mielczarek
13 years, 4 months ago #1
Mark Mentovai
I just read the first few files. After reading this, I’m on the fence about ...
13 years, 4 months ago #2
Ted Mielczarek
On 2010/12/09 02:40:28, Mark Mentovai wrote: > I just read the first few files. > ...
13 years, 4 months ago #3
Ted Mielczarek
13 years, 4 months ago #4
Ted Mielczarek
Ok, this should address all of your existing review comments. I rearranged quite a bit ...
13 years, 4 months ago #5
Mark Mentovai
LGTM otherwise Sorry that this is mostly a style review. It’s large and monotonous. http://breakpad.appspot.com/241001/diff/8001/9002 ...
13 years, 4 months ago #6
Ted Mielczarek
13 years, 4 months ago #7
Thanks for the review. That's okay, it's a large and monotonous patch. Certainly
wound up being larger than I anticipated.

http://breakpad.appspot.com/241001/diff/8001/9002
File src/client/mac/handler/breakpad_nlist_64.cc (right):

http://breakpad.appspot.com/241001/diff/8001/9002#newcode300
Line 300: // nealsid:iterate through all load commands, looking for
On 2010/12/15 18:53:24, Mark Mentovai wrote:
> Should this be TODO(nealsid):?

No, I think he was just annotating what he added at the time? I can just remove
the nealsid bit.

http://breakpad.appspot.com/241001/diff/8001/9002#newcode378
Line 378: goto cont;
On 2010/12/15 18:53:24, Mark Mentovai wrote:
> This is kind of ugly. Is there a cleaner way? (381 too.)

I don't know, I honestly haven't taken the time to fully understand this
function, so I'm worried about making more than simple mechanical changes to it
in the name of style. Changing the control flow is worrisome to me, so I'd
prefer to avoid it, even if it is truly ugly.

http://breakpad.appspot.com/241001/diff/8001/9004
File src/client/mac/handler/dynamic_images.cc (right):

http://breakpad.appspot.com/241001/diff/8001/9004#newcode143
Line 143: return string("");
On 2010/12/15 18:53:24, Mark Mentovai wrote:
> Is the "" necessary? string() is an empty string and may be slightly less
work.

Probably not. I think I might have had a bare string literal there at one point
and decided the explicit constructor was better.

http://breakpad.appspot.com/241001/diff/8001/9006
File src/client/mac/handler/minidump_generator.cc (right):

http://breakpad.appspot.com/241001/diff/8001/9006#newcode393
Line 393: reinterpret_cast<ppc_thread_state_t *>(state);
On 2010/12/15 18:53:24, Mark Mentovai wrote:
> Indent. Also on 401, 409, 417, 427…

Clearly I need to fix my Emacs settings. Sorry about that.

http://breakpad.appspot.com/241001/diff/8001/9007
File src/client/mac/handler/minidump_generator.h (right):

http://breakpad.appspot.com/241001/diff/8001/9007#newcode50
Line 50: const u_int64_t TOP_OF_THREAD0_STACK_64BIT = 0x00007fff5fbff000LL;
On 2010/12/15 18:53:24, Mark Mentovai wrote:
> Yuck to hardcoding these. (I said the same thing when this was written many
> years ago.)

I believe this is http://code.google.com/p/google-breakpad/issues/detail?id=247
.

http://breakpad.appspot.com/241001/diff/8001/9008
File src/client/mac/tests/minidump_generator_test.cc (right):

http://breakpad.appspot.com/241001/diff/8001/9008#newcode38
Line 38: #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
On 2010/12/15 18:53:24, Mark Mentovai wrote:
> The stuff below seems to use 10_6?

Oops.
Sign in to reply to this message.

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