Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Issue 1336823002: win x86: Grab bag of restructuring to get tests working on x86-on-x86 (Closed)

Created:
5 years, 3 months ago by scottmg
Modified:
5 years, 3 months ago
Reviewers:
Mark Mentovai
CC:
crashpad-dev_chromium.org
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@master
Target Ref:
refs/heads/master
Project:
crashpad
Visibility:
Public.

Description

win x86: Grab bag of restructuring to get tests working on x86-on-x86 A few function implementations that were missing, various switches for functions/functionality that didn't exist on XP, and far too long figuring out what exactly was wrong with SYSTEM_PROCESS_INFORMATION on x86 (the "alignment_for_x86" fields). R=mark@chromium.org BUG=crashpad:1, crashpad:50, chromium:531663 Committed: https://chromium.googlesource.com/crashpad/crashpad/+/8ce88d89536615bcc332859fcd7ba00e43cd80db

Patch Set 1 #

Patch Set 2 : thread info #

Patch Set 3 : rebase #

Patch Set 4 : . #

Patch Set 5 : tidy #

Patch Set 6 : rebase #

Patch Set 7 : handle wow64 cases #

Patch Set 8 : fix thread pull and add test #

Patch Set 9 : fix test not erroring on expect fail #

Patch Set 10 : . #

Total comments: 54

Patch Set 11 : fixes #

Total comments: 9

Patch Set 12 : fixes2 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+499 lines, -243 lines) Patch
M snapshot/win/cpu_context_win.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +104 lines, -37 lines 1 comment Download
M snapshot/win/cpu_context_win_test.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +22 lines, -3 lines 0 comments Download
M snapshot/win/exception_snapshot_win.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -0 lines 0 comments Download
M snapshot/win/exception_snapshot_win.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +49 lines, -27 lines 0 comments Download
M snapshot/win/pe_image_reader_test.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +13 lines, -1 line 0 comments Download
M snapshot/win/process_reader_win.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -1 line 0 comments Download
M snapshot/win/process_reader_win.cc View 1 2 3 4 5 6 7 8 9 10 11 10 chunks +79 lines, -56 lines 2 comments Download
M snapshot/win/process_reader_win_test.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +43 lines, -5 lines 0 comments Download
M snapshot/win/thread_snapshot_win.cc View 1 chunk +5 lines, -1 line 0 comments Download
M test/win/win_child_process_test.cc View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -2 lines 0 comments Download
M util/util_test.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M util/win/process_info.h View 1 2 3 4 5 6 1 chunk +6 lines, -1 line 0 comments Download
M util/win/process_info.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +79 lines, -62 lines 0 comments Download
M util/win/process_structs.h View 1 2 3 4 5 6 7 8 9 3 chunks +83 lines, -47 lines 0 comments Download

Messages

Total messages: 22 (3 generated)
scottmg
(There's not much tying this CL together except the end goal. If you think it'd ...
5 years, 3 months ago (2015-09-15 21:13:35 UTC) #2
Mark Mentovai
The grab bag approach is fine. https://codereview.chromium.org/1336823002/diff/180001/snapshot/win/cpu_context_win.cc File snapshot/win/cpu_context_win.cc (right): https://codereview.chromium.org/1336823002/diff/180001/snapshot/win/cpu_context_win.cc#newcode1 snapshot/win/cpu_context_win.cc:1: // Copyright 2015 ...
5 years, 3 months ago (2015-09-16 02:57:20 UTC) #3
scottmg
Thanks! https://codereview.chromium.org/1336823002/diff/180001/snapshot/win/cpu_context_win.cc File snapshot/win/cpu_context_win.cc (right): https://codereview.chromium.org/1336823002/diff/180001/snapshot/win/cpu_context_win.cc#newcode1 snapshot/win/cpu_context_win.cc:1: // Copyright 2015 The Crashpad Authors. All rights ...
5 years, 3 months ago (2015-09-16 18:05:07 UTC) #5
Mark Mentovai
LGTM https://codereview.chromium.org/1336823002/diff/220001/snapshot/win/cpu_context_win.cc File snapshot/win/cpu_context_win.cc (right): https://codereview.chromium.org/1336823002/diff/220001/snapshot/win/cpu_context_win.cc#newcode32 snapshot/win/cpu_context_win.cc:32: Maybe also LOG_IF(…, !(context.ContextFlags & CONTEXT_AMD64)), and similar ...
5 years, 3 months ago (2015-09-16 18:56:58 UTC) #6
scottmg
https://codereview.chromium.org/1336823002/diff/220001/snapshot/win/cpu_context_win.cc File snapshot/win/cpu_context_win.cc (right): https://codereview.chromium.org/1336823002/diff/220001/snapshot/win/cpu_context_win.cc#newcode32 snapshot/win/cpu_context_win.cc:32: On 2015/09/16 18:56:58, Mark Mentovai - August is over ...
5 years, 3 months ago (2015-09-16 19:38:21 UTC) #8
scottmg
Committed patchset #12 (id:260001) manually as 8ce88d89536615bcc332859fcd7ba00e43cd80db (presubmit successful).
5 years, 3 months ago (2015-09-16 19:42:25 UTC) #9
Mark Mentovai
https://codereview.chromium.org/1336823002/diff/220001/snapshot/win/process_reader_win.cc File snapshot/win/process_reader_win.cc (right): https://codereview.chromium.org/1336823002/diff/220001/snapshot/win/process_reader_win.cc#newcode321 snapshot/win/process_reader_win.cc:321: thread.stack_region_size = tib.StackBase - tib.StackLimit; scottmg wrote: > Ooh, ...
5 years, 3 months ago (2015-09-16 19:44:15 UTC) #10
scottmg
Oops, apparently crashing on x86 release, looking...
5 years, 3 months ago (2015-09-16 19:50:54 UTC) #11
Mark Mentovai
https://codereview.chromium.org/1336823002/diff/260001/snapshot/win/cpu_context_win.cc File snapshot/win/cpu_context_win.cc (right): https://codereview.chromium.org/1336823002/diff/260001/snapshot/win/cpu_context_win.cc#newcode64 snapshot/win/cpu_context_win.cc:64: // SegDs ignored. Here’s a question that’s got nothing ...
5 years, 3 months ago (2015-09-16 20:52:59 UTC) #12
scottmg
On 2015/09/16 20:52:59, Mark Mentovai - August is over wrote: > https://codereview.chromium.org/1336823002/diff/260001/snapshot/win/cpu_context_win.cc > File snapshot/win/cpu_context_win.cc ...
5 years, 3 months ago (2015-09-16 20:59:58 UTC) #13
scottmg
On 2015/09/16 19:50:54, scottmg wrote: > Oops, apparently crashing on x86 release, looking... It's crashing ...
5 years, 3 months ago (2015-09-16 21:00:35 UTC) #14
Mark Mentovai
scottmg wrote: > I ... don't know anything about that. :) > > The are ...
5 years, 3 months ago (2015-09-16 21:23:11 UTC) #15
scottmg
On 2015/09/16 21:00:35, scottmg wrote: > On 2015/09/16 19:50:54, scottmg wrote: > > Oops, apparently ...
5 years, 3 months ago (2015-09-16 21:30:09 UTC) #16
Mark Mentovai
https://codereview.chromium.org/1336823002/diff/260001/snapshot/win/process_reader_win.cc File snapshot/win/process_reader_win.cc (right): https://codereview.chromium.org/1336823002/diff/260001/snapshot/win/process_reader_win.cc#newcode146 snapshot/win/process_reader_win.cc:146: if (!GetThreadContext(thread_handle, &thread->context)) { I was looking at the ...
5 years, 3 months ago (2015-09-18 03:30:51 UTC) #17
scottmg
https://codereview.chromium.org/1336823002/diff/260001/snapshot/win/process_reader_win.cc File snapshot/win/process_reader_win.cc (right): https://codereview.chromium.org/1336823002/diff/260001/snapshot/win/process_reader_win.cc#newcode146 snapshot/win/process_reader_win.cc:146: if (!GetThreadContext(thread_handle, &thread->context)) { On 2015/09/18 03:30:51, Mark Mentovai ...
5 years, 3 months ago (2015-09-18 03:50:09 UTC) #18
scottmg
On 2015/09/18 03:50:09, scottmg wrote: > https://codereview.chromium.org/1336823002/diff/260001/snapshot/win/process_reader_win.cc > File snapshot/win/process_reader_win.cc (right): > > https://codereview.chromium.org/1336823002/diff/260001/snapshot/win/process_reader_win.cc#newcode146 > ...
5 years, 3 months ago (2015-09-18 04:01:30 UTC) #19
Mark Mentovai
scottmg wrote: > > 2/3rds of the way through the comment sludge... :) :( > ...
5 years, 3 months ago (2015-09-18 15:09:49 UTC) #20
scottmg
https://codereview.chromium.org/1336823002/diff/180001/snapshot/win/cpu_context_win.cc File snapshot/win/cpu_context_win.cc (right): https://codereview.chromium.org/1336823002/diff/180001/snapshot/win/cpu_context_win.cc#newcode102 snapshot/win/cpu_context_win.cc:102: memcpy(&out->fxsave, &context.ExtendedRegisters, sizeof(out->fxsave)); On 2015/09/16 02:57:19, Mark Mentovai - ...
5 years, 3 months ago (2015-09-22 18:14:56 UTC) #21
Mark Mentovai
5 years, 3 months ago (2015-09-22 18:23:15 UTC) #22
Message was sent while issue was closed.
https://codereview.chromium.org/1336823002/diff/180001/snapshot/win/cpu_conte...
File snapshot/win/cpu_context_win.cc (right):

https://codereview.chromium.org/1336823002/diff/180001/snapshot/win/cpu_conte...
snapshot/win/cpu_context_win.cc:102: memcpy(&out->fxsave,
&context.ExtendedRegisters, sizeof(out->fxsave));
On 2015/09/22 18:14:56, scottmg wrote:
> On 2015/09/16 02:57:19, Mark Mentovai - August is over wrote:
> > ExtendedRegisters won’t be valid on a CPU that doesn’t support fxsave
(meaning
> > those that don’t support SSE), but there will still be valid x87 state in
> > FloatSave. In that case, ContextFlags won’t have CONTEXT_EXTENDED_REGISTERS
> but
> > will have CONTEXT_FLOATING_POINT. When this happens, we should fill out as
> much
> > of out->fxsave as we can given the x87 data, and zero out the rest. Most of
> this
> > is straightforward, but we’ll need to add an FsaveToFxsaveTagWord()
function.
> > That part is a little involved and it’s OK to do in its own change if you’d
> > like. Fortunately, I already wrote the inverse function, which is much more
> > complex. Going from the full fsave to the abridged fxsave tag word is easier
> > because you don’t need to interpret the x87 st registers at all, but you
will
> > need to map between physical and logical slots based on fsw.
> 
> I just digested this a little better... fxsave became available with SSE (1),
> right?

Yup, that’s right.

> I don't think there's much point in supporting pre-SSE hardware given
> that VS2013 assumes SSE2, and Chrome has required it for quite a while now:
> https://code.google.com/p/chromium/issues/detail?id=349320.

Oh, I remember that bug now. I forgot that Chrome required SSE on Windows. I was
remembering some old code in Chrome that had to test for SSE or SSE2 on Windows
and Linux, but was allowed to assume it was available on Mac.

Powered by Google App Engine
This is Rietveld 408576698