17
Comunidade Portuguesa de SharePoint Reunião Presencial 12/06/2010

Spug pt session2 - debuggingl

Embed Size (px)

DESCRIPTION

2 Presentation Presentation o Rui Melo, SharePoint Consultant in Microsoft

Citation preview

Page 1: Spug pt session2 - debuggingl

Comunidade Portuguesa de SharePoint

2ª Reunião Presencial

12/06/2010

Page 2: Spug pt session2 - debuggingl

Agenda

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

Page 3: Spug pt session2 - debuggingl

Session goals

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

Page 4: Spug pt session2 - debuggingl

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

Page 5: Spug pt session2 - debuggingl

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

Page 6: Spug pt session2 - debuggingl

Debug = Solve a problem

Techniques + Tools = gather information

Bottom line

Page 8: Spug pt session2 - debuggingl

Depends on how it was built...

Page 9: Spug pt session2 - debuggingl

Screen dumps

• Setup your web.config

Page 10: Spug pt session2 - debuggingl

Logs

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

Page 11: Spug pt session2 - debuggingl

Code debug

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

Page 12: Spug pt session2 - debuggingl

Web debug

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

Page 13: Spug pt session2 - debuggingl

Runtime debug: kernel output

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

messages• Sysinternals Debug view

Page 14: Spug pt session2 - debuggingl

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

Page 15: Spug pt session2 - debuggingl

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!!

Page 16: Spug pt session2 - debuggingl

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

Page 17: Spug pt session2 - debuggingl

Comunidade Portuguesa de SharePoint

2ª Reunião Presencial

12/06/2010