windbg dot net_clr2

16
Debugging DotNet app Debugging DotNet app with Windbg + SOS with Windbg + SOS Winson Winson

Upload: wei-sun

Post on 18-Dec-2014

859 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Windbg dot net_clr2

Debugging DotNet app Debugging DotNet app with Windbg + SOSwith Windbg + SOS

WinsonWinson

Page 2: Windbg dot net_clr2

Why?Why?

Crash dump analysisCrash dump analysis

CLR internalCLR internal

Pre-requirement: download & installing Pre-requirement: download & installing WinDbg from MSDNWinDbg from MSDN

Page 3: Windbg dot net_clr2

Microsoft Office PowerPoint 2007 Present

Page 4: Windbg dot net_clr2

http://msdn.microsoft.com/en-us/magazine/cc163791.aspx

Microsoft Word Document

Page 5: Windbg dot net_clr2

C:\Program Files\Debugging Tools for Windows (x86)C:\Program Files\Debugging Tools for Windows (x86)

C:\Windows\Microsoft.NET\Framework\v2.0.50727C:\Windows\Microsoft.NET\Framework\v2.0.50727 mscordacwks.dll mscorwks.dll SOS.dllmscordacwks.dll mscorwks.dll SOS.dll

Page 6: Windbg dot net_clr2

Sample appSample app

Page 7: Windbg dot net_clr2

srv*c:\symbols*http://msdl.microsoft.com/download/symbols

Page 8: Windbg dot net_clr2

Start running target appStart running target app

The code has console.readkey(), so could keep in The code has console.readkey(), so could keep in memorymemory

Using “start without debugging”Using “start without debugging”

Page 9: Windbg dot net_clr2

Using “Attach to running process”Using “Attach to running process”

Don’t know why I can’t use “open executable…”. In my Don’t know why I can’t use “open executable…”. In my testing only “attach..” could load sos.testing only “attach..” could load sos.

Page 10: Windbg dot net_clr2

Using command “.load sos”

Page 11: Windbg dot net_clr2

!sos.help!help funcname

Page 12: Windbg dot net_clr2

!dumpheap

Page 13: Windbg dot net_clr2

!dumpheap –type Program

Page 14: Windbg dot net_clr2

!dumpobj 01359be0

Page 15: Windbg dot net_clr2

VideoVideo

http://channel9.msdn.com/blogs/egibson/msdn-simulcashttp://channel9.msdn.com/blogs/egibson/msdn-simulcast-techniques-in-advanced-net-debugging-with-john-robbit-techniques-in-advanced-net-debugging-with-john-robbins-part-1-of-3ns-part-1-of-3

Page 16: Windbg dot net_clr2

LinksLinks

http://blogs.msdn.com/b/tess/http://blogs.msdn.com/b/tess/

http://www.codeproject.com/KB/cs/net_type_internals.ashttp://www.codeproject.com/KB/cs/net_type_internals.aspxpx

http://blogs.msdn.com/b/dougste/archive/2008/08/08/a-bihttp://blogs.msdn.com/b/dougste/archive/2008/08/08/a-big-list-of-debugging-resources.aspxg-list-of-debugging-resources.aspx

http://www.microsoft.com/download/en/details.aspx?id=2http://www.microsoft.com/download/en/details.aspx?id=21255 1255 Psscor Managed-Code Debugging Extension foPsscor Managed-Code Debugging Extension for WinDbgr WinDbg

http://blogs.msdn.com/b/tess/archive/2010/03/01/nehttp://blogs.msdn.com/b/tess/archive/2010/03/01/new-commands-in-sos-for-net-4-0-part-1.aspxw-commands-in-sos-for-net-4-0-part-1.aspx

http://blogs.msdn.com/b/tom/http://blogs.msdn.com/b/tom/