goldshtn / msos

Command-line environment a-la WinDbg for executing SOS commands without having SOS available.
Other
96 stars 21 forks source link

Fetching extended handles data for live-process/dump file #52

Closed Pavel-Durov closed 8 years ago

Pavel-Durov commented 8 years ago

WaitChains command now collects BlockingObjects information for live process and dump file threads.

Handles information source used with Live Process: Managed threads: ClrMd Native Threads: WCT (Wait Chain Traversal Api)

Handles information source used with Dump File: Managed threads: ClrMd, StackWalker (only x86 supported) Native Threads: MiniDump, StackWalker(only x86 supported)

StackWalker.cs Inspects frames for wait calls : WaitForSingleObject, WaitForMultipleObjects, EnterCriticalSection. When frame name detected StackWalker reads frame parameters accordingly to x86 Calling Convention.

WaitChainTraversal.cs Gets WCT information using WCT api by the given threadId (OS threadId)

MiniDump.cs Maps given dump file into memory and extracts MiniDumpHandles from it.

goldshtn commented 8 years ago

Hey, a couple of comments:

  1. Please add a description that explains your changes, the major pieces you added, what is now supported that wasn't supported before
  2. Please change the commit message to something meaningful as well -- you can do this with git commit --amend followed by a force push git push -f origin mybranch
  3. It looks like you're adding the Minidump.cs file to msos; but it's already in CLRMD, and the version of CLRMD I'm using for msos has [InternalsVisibleTo("msos")], so you can use this functionality from there
goldshtn commented 8 years ago

Also please note that the build failed, in case you don't see the build log:

NativeStructs.cs(50,30): error CS0227: Unsafe code may only appear if compiling with /unsafe [C:\projects\msos\msos\msos.csproj]
NativeStructs.cs(67,30): error CS0227: Unsafe code may only appear if compiling with /unsafe [C:\projects\msos\msos\msos.csproj]
NativeStructs.cs(177,30): error CS0227: Unsafe code may only appear if compiling with /unsafe [C:\projects\msos\msos\msos.csproj]
NativeStructs.cs(204,30): error CS0227: Unsafe code may only appear if compiling with /unsafe [C:\projects\msos\msos\msos.csproj]
MiniDump.cs(401,25): error CS0227: Unsafe code may only appear if compiling with /unsafe [C:\projects\msos\msos\msos.csproj]
MiniDump.cs(419,25): error CS0227: Unsafe code may only appear if compiling with /unsafe [C:\projects\msos\msos\msos.csproj]
MiniDump.cs(453,35): error CS0227: Unsafe code may only appear if compiling with /unsafe [C:\projects\msos\msos\msos.csproj]
MiniDump.cs(459,35): error CS0227: Unsafe code may only appear if compiling with /unsafe [C:\projects\msos\msos\msos.csproj]
MiniDump.cs(503,34): error CS0227: Unsafe code may only appear if compiling with /unsafe [C:\projects\msos\msos\msos.csproj]
StackWalker.cs(260,37): error CS0227: Unsafe code may only appear if compiling with /unsafe [C:\projects\msos\msos\msos.csproj]
StackWalker.cs(308,37): error CS0227: Unsafe code may only appear if compiling with /unsafe [C:\projects\msos\msos\msos.csproj]
WaitChains.cs(199,48): error CS0227: Unsafe code may only appear if compiling with /unsafe [C:\projects\msos\msos\msos.csproj]
goldshtn commented 8 years ago

Can you please remove the AnyCPU configurations?

goldshtn commented 8 years ago

I still see AnyCPU mentioned in the .sln file.