Spug pt session2 - debuggingl

Preview:

DESCRIPTION

2 Presentation Presentation o Rui Melo, SharePoint Consultant in Microsoft

Citation preview

Comunidade Portuguesa de SharePoint

2ª Reunião Presencial

12/06/2010

Agenda

• Session goals• Definition• How hard can it be?• Screen dumps• Logs• Code debug• Web debug• Runtime & kernel debug

Session goals

• Debugging overview• Debug tools• Where to go from here

In wikipedia:

Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected. … it involves numerous aspects, including: interactive debugging, control flow, integration testing, log files, monitoring, memory dumps, Statistical Process Control, and special design tactics to improve detection while simplifying changes.

Definition

In wikipedia:

Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected. … it involves numerous aspects, including: interactive debugging, control flow, integration testing, log files, monitoring, memory dumps, Statistical Process Control, and special design tactics to improve detection while simplifying changes.

Definition

Debug = Solve a problem

Techniques + Tools = gather information

Bottom line

Depends on how it was built...

Screen dumps

• Setup your web.config

Logs

• Event logs (eventvwr)• IIS Logs (c:\windows\system32\logfiles\...)• ULS (...\12\logs)• Custom logs (i.e. Ent. Lib.)

Code debug

• Visual studio w/ code solution• Attach the right process:– W3wp– Owstimer

Web debug

• Soap toolkit tracer (deprecated but very usefull)• Fiddler• Wireshark (protocol analizer)

Runtime debug: kernel output

• Messages are thrown to the kernel• Any tool can plug into the kernel and read the

messages• Sysinternals Debug view

Runtime debug: kernel (windbg)

• Attach directly to a process• Identify process with windbg• Main commands– .loadby sos mscorwks– Sxe clr– !g (F5)– !pe– !do | !da– !dso– -clrstack –a– !analize

Toolbox (some tools)

• MS windbg (http://www.microsoft.com/whdc/devtools/debugging/default.mspx) • Sysinternals tools: process explorer, debug view (http://live.sysinternals.com)• Fiddler (http://www.fiddler2.com/fiddler2/) • Soap Trace Utility (

http://www.microsoft.com/downloads/details.aspx?familyid=c943c0dd-ceec-4088-9753-86f052ec8450&displaylang=en)

• Please fill IN!!

Further reading

• Tess Ferrandez (http://blogs.msdn.com/b/tess/) • Production Debugging for .NET Framework Applications (P&P) http://

msdn.microsoft.com/en-us/library/ee817663.aspx • http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx

– Debugger How-Tos Driver Tip: Debugging Windows Vista – Improve Driver Debugability – 1394 Kernel Debugging Tips and Tricks [WinHEC 2004; 373 KB]– Advanced Driver Debugging [336 KB] – Driver Debugging Basics [WinHEC 2007; 633 KB] – Debugging Kernel-Mode Driver Framework Drivers – Debugging User-Mode Driver Framework Drivers Training Sessions – Debugging Tools for Windows (MSDN) – HOWTO: Enable Verbose Debug Tracing in Various Drivers and Subsystems (314743) – WDK Online: Tools for Debugging Drivers

Comunidade Portuguesa de SharePoint

2ª Reunião Presencial

12/06/2010