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

Issue 1133203002: win: Retrieve thread context for x64 (Closed)

Created:
5 years, 7 months ago by scottmg
Modified:
5 years, 7 months ago
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: Retrieve thread context for x64 Retrieve context and save to thread context. NtQueryInformationThread is no longer required (right now?) because to retrieve the CONTEXT, the thread needs to be Suspend/ResumeThread'd anyway, and the return value of SuspendThread is the previous SuspendCount. I haven't handle the x86 case yet -- that would ideally be via Wow64GetThreadContext (I think) but unfortunately that's Vista+, so I'll likely need to to a bit of fiddling to get that sorted out. (It's actually likely going to be NtQueryInformationThread again, but one thing at a time for now.) R=cpu@chromium.org, rsesek@chromium.org TBR=mark@chromium.org BUG=crashpad:1 Committed: https://chromium.googlesource.com/crashpad/crashpad/+/5a21de6a1bf4b75fb0ada218531b9ec7f0cbdb49

Patch Set 1 #

Total comments: 7

Patch Set 2 : fix context retrieve #

Patch Set 3 : remove temp changes #

Total comments: 2

Patch Set 4 : don't self-suspend #

Total comments: 4

Patch Set 5 : fix #

Total comments: 2

Patch Set 6 : stub dr4/5 #

Patch Set 7 : . #

Total comments: 2

Patch Set 8 : fix current thread #

Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -65 lines) Patch
M snapshot/win/process_reader_win.h View 1 chunk +1 line, -0 lines 0 comments Download
M snapshot/win/process_reader_win.cc View 1 2 3 4 5 6 7 5 chunks +56 lines, -64 lines 0 comments Download
M snapshot/win/process_reader_win_test.cc View 1 2 3 4 5 6 7 1 chunk +22 lines, -0 lines 0 comments Download
M snapshot/win/thread_snapshot_win.h View 1 chunk +6 lines, -0 lines 0 comments Download
M snapshot/win/thread_snapshot_win.cc View 1 2 3 4 5 6 2 chunks +61 lines, -1 line 0 comments Download
M tools/generate_dump.cc View 1 chunk +1 line, -0 lines 0 comments Download
M util/win/process_structs.h View 1 2 3 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (2 generated)
cpu_(ooo_6.6-7.5)
https://codereview.chromium.org/1133203002/diff/1/snapshot/win/process_reader_win.cc File snapshot/win/process_reader_win.cc (right): https://codereview.chromium.org/1133203002/diff/1/snapshot/win/process_reader_win.cc#newcode175 snapshot/win/process_reader_win.cc:175: CONTEXT context; = {0} ? or you imagine that ...
5 years, 7 months ago (2015-05-12 01:06:50 UTC) #2
scottmg
Sorry, wasn't ready for review yet. I'll take a look at those and ping you ...
5 years, 7 months ago (2015-05-12 01:55:33 UTC) #3
scottmg
OK, ready for a look now, thanks. https://codereview.chromium.org/1133203002/diff/60001/snapshot/win/process_reader_win.cc File snapshot/win/process_reader_win.cc (right): https://codereview.chromium.org/1133203002/diff/60001/snapshot/win/process_reader_win.cc#newcode308 snapshot/win/process_reader_win.cc:308: thread.stack_region_address = ...
5 years, 7 months ago (2015-05-12 17:48:59 UTC) #5
scottmg
(Added a check for suspending ourself in the thread grabber -- one of the tests ...
5 years, 7 months ago (2015-05-12 19:37:05 UTC) #6
cpu_(ooo_6.6-7.5)
https://codereview.chromium.org/1133203002/diff/80001/snapshot/win/process_reader_win.cc File snapshot/win/process_reader_win.cc (right): https://codereview.chromium.org/1133203002/diff/80001/snapshot/win/process_reader_win.cc#newcode169 snapshot/win/process_reader_win.cc:169: NtCurrentTeb())->ClientId.UniqueThread; seems we can do is_current_thread before we open ...
5 years, 7 months ago (2015-05-12 21:31:22 UTC) #7
scottmg
https://codereview.chromium.org/1133203002/diff/80001/snapshot/win/process_reader_win.cc File snapshot/win/process_reader_win.cc (right): https://codereview.chromium.org/1133203002/diff/80001/snapshot/win/process_reader_win.cc#newcode169 snapshot/win/process_reader_win.cc:169: NtCurrentTeb())->ClientId.UniqueThread; On 2015/05/12 21:31:21, cpu wrote: > seems we ...
5 years, 7 months ago (2015-05-12 22:06:37 UTC) #8
Robert Sesek
https://codereview.chromium.org/1133203002/diff/100001/snapshot/win/thread_snapshot_win.cc File snapshot/win/thread_snapshot_win.cc (right): https://codereview.chromium.org/1133203002/diff/100001/snapshot/win/thread_snapshot_win.cc#newcode52 snapshot/win/thread_snapshot_win.cc:52: out->dr3 = context.Dr3; Dr4, 5, and 6 are missing?
5 years, 7 months ago (2015-05-12 22:33:23 UTC) #9
scottmg
https://codereview.chromium.org/1133203002/diff/100001/snapshot/win/thread_snapshot_win.cc File snapshot/win/thread_snapshot_win.cc (right): https://codereview.chromium.org/1133203002/diff/100001/snapshot/win/thread_snapshot_win.cc#newcode52 snapshot/win/thread_snapshot_win.cc:52: out->dr3 = context.Dr3; On 2015/05/12 22:33:22, Robert Sesek wrote: ...
5 years, 7 months ago (2015-05-12 23:09:24 UTC) #10
cpu_(ooo_6.6-7.5)
https://codereview.chromium.org/1133203002/diff/140001/snapshot/win/process_reader_win.cc File snapshot/win/process_reader_win.cc (right): https://codereview.chromium.org/1133203002/diff/140001/snapshot/win/process_reader_win.cc#newcode190 snapshot/win/process_reader_win.cc:190: return; "If you call GetThreadContext for the current thread, ...
5 years, 7 months ago (2015-05-13 00:58:29 UTC) #11
scottmg
https://codereview.chromium.org/1133203002/diff/140001/snapshot/win/process_reader_win.cc File snapshot/win/process_reader_win.cc (right): https://codereview.chromium.org/1133203002/diff/140001/snapshot/win/process_reader_win.cc#newcode190 snapshot/win/process_reader_win.cc:190: return; On 2015/05/13 00:58:29, cpu wrote: > "If you ...
5 years, 7 months ago (2015-05-13 17:16:37 UTC) #12
Robert Sesek
LGTM if cpu is happy
5 years, 7 months ago (2015-05-13 21:09:32 UTC) #13
cpu_(ooo_6.6-7.5)
lgtm
5 years, 7 months ago (2015-05-15 00:32:44 UTC) #14
scottmg
5 years, 7 months ago (2015-05-15 00:37:08 UTC) #15
Message was sent while issue was closed.
Committed patchset #8 (id:160001) manually as
5a21de6a1bf4b75fb0ada218531b9ec7f0cbdb49 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698