13 Commits

Author SHA1 Message Date
Scott Graham
4893a9b76d win: Capture some CRITICAL_SECTION debugging data
Capture the memory for the loader lock (can be inspected by !cs), as
well as all locks that were created with .DebugInfo which can be viewed
with !locks.

e.g.

0:000> !cs ntdll!LdrpLoaderLock
-----------------------------------------
Critical section   = 0x778d6410 (ntdll!LdrpLoaderLock+0x0)
DebugInfo          = 0x778d6b6c
NOT LOCKED
LockSemaphore      = 0x0
SpinCount          = 0x04000000

0:000> !locks -v

CritSec ntdll!RtlpProcessHeapsListLock+0 at 778d7620
LockCount          NOT LOCKED
RecursionCount     0
OwningThread       0
EntryCount         0
ContentionCount    0

CritSec +7a0248 at 007a0248
LockCount          NOT LOCKED
RecursionCount     0
OwningThread       0
EntryCount         0
ContentionCount    0

CritSec crashy_program!g_critical_section_with_debug_info+0 at 01342c48
LockCount          NOT LOCKED
RecursionCount     0
OwningThread       0
EntryCount         0
ContentionCount    0

CritSec crashy_program!crashpad::`anonymous namespace'::g_test_critical_section+0 at 01342be0
WaiterWoken        No
LockCount          0
RecursionCount     1
OwningThread       34b8
EntryCount         0
ContentionCount    0
*** Locked

Scanned 4 critical sections

R=mark@chromium.org
BUG=crashpad:52

Review URL: https://codereview.chromium.org/1392093003 .
2015-10-15 13:18:08 -07:00
Scott Graham
3a886267aa win: Fix OpenProcess(PROCESS_ALL_ACCESS, ...) on XP
PROCESS_ALL_ACCESS was changed in later SDKs and the newer value fails
when run on XP with ERROR_ACCESS_DENIED. Use the old value to maintain
compatibility with XP.

R=mark@chromium.org
BUG=crashpad:50

Review URL: https://codereview.chromium.org/1337133002 .
2015-09-11 13:16:06 -07:00
Scott Graham
d7f90b45b6 win: Fix incorrect thread suspend count due to ScopedProcessSuspend
After https://codereview.chromium.org/1303173011/, the thread suspend
count would be one too large because the count is adjusted when the
process is suspended. Counteract this by passing in whether the
process is suspended or not so that the thread's suspension count
can be adjusted.

Add a test to sanity-check thread suspend count.

R=mark@chromium.org

Review URL: https://codereview.chromium.org/1326443007 .
2015-09-09 12:29:29 -07:00
Scott Graham
5111a1823f win: Implement and use ScopedProcessSuspend
R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/1303173011 .
2015-09-08 10:09:26 -07:00
Scott Graham
5a21de6a1b 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

Review URL: https://codereview.chromium.org/1133203002
2015-05-14 17:37:02 -07:00
Scott Graham
b2e78eb3c5 Revert "Intentional compile error to test bot changes"
This reverts commit f8c763e6c081a524c8b0c5b43ff53e02c956a53a.

TBR=dpranke@chromium.org
BUG=crashpad:37

Review URL: https://codereview.chromium.org/1136633002
2015-05-07 15:20:49 -07:00
Scott Graham
f8c763e6c0 Intentional compile error to test bot changes
TBR=dpranke@chromium.org
BUG=crashpad:37

Review URL: https://codereview.chromium.org/1135663002
2015-05-07 15:19:00 -07:00
Scott Graham
ff52791faf Get generate_dump compiling on Windows
Sort of works in that the process is opened, modules retrieved, etc.
but eventually CHECKs due to missing functionality in snapshot.

Follows https://codereview.chromium.org/1119783005/.

R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/1120383003
2015-05-06 11:09:31 -07:00
Mark Mentovai
6f4e6aacc8 Add crashpad_database_util and its man page.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1022663002
2015-03-19 18:41:01 -04:00
Scott Graham
6865865773 Change 'bool world_readable' to an enum
More clear at callsites, and relatively important not to accidentally choose the wrong one.

R=mark@chromium.org

Review URL: https://codereview.chromium.org/821483002
2014-12-19 15:35:30 -08:00
Scott Graham
5f5e342584 Switch [String]FileWriter to use new file_io.h functions/types
Also add ScopedFileHandle as cross-platform version of ScopedFD/ScopedFileHANDLE.

R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/815053004
2014-12-19 13:33:01 -08:00
Mark Mentovai
22b2f0cad7 tools: Use hyphens instead of underscores for multi-word option names.
Option names like --mach-service are easier to type than --mach_service.
Command-line tools don’t necessarily have the most ergonomic interfaces
anyway, but this is an improvement.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/774763006
2014-12-04 16:46:12 -05:00
Mark Mentovai
09d3a6c695 Add the generate_dump tool.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/727983002
2014-11-14 19:21:43 -05:00