140 likes | 493 Views
Debugging Script in IE using Microsoft Script Debugger & Visual Studio .NET 2005 . April 15, 2007. Change IE setting to enable debug. IE Debug Tools. Microsoft Visual Studio .Net 2000/2003/2005 Download Visual Web Developer 2005 free from: http://msdn.microsoft.com/vstudio/express/downloads/
E N D
Debugging Script in IE using Microsoft Script Debugger & Visual Studio .NET 2005 April 15, 2007
IE Debug Tools • Microsoft Visual Studio .Net 2000/2003/2005 • Download Visual Web Developer 2005 free from: http://msdn.microsoft.com/vstudio/express/downloads/ • Microsoft Script Debugger • Microsoft Script Editor • installed with Office 2003 • Office 2007 has removed it.
Get Microsoft Script Debugger • http://www.microsoft.com/downloads/details.aspx?familyid=2F465BE0-94FD-4569-B3C4-DFFDF19CCD99&displaylang=en • Advantage • Light weight, scd10en.exe only 653kb • Shortcoming • Less functions than VS.NET
VisualStudio .NET 2005 • To debug: • Client scripts • Server scripts • Allowing you to: • View the source code of the script you are debugging. • Control the pace of script execution. • View and change variable and property values. • View and control script flow.
Ways to trigger debugger • Manually • Attach to IE process • From your browser • View->Script Debugger->Open • View->Script Debugger->Break at next statement • Programmatically • VBScript: stop • JavaScript: debugger: Suspends execution. • By responding to a script error
Debugging facilities • Script Explorer: Debug -> Windows -> Script Explorer • Viewing source • Set breakpoints • Controlling program execution • Stepover, F10; Step into, F11; Step out, • Viewing and controlling program flow • Move up to down in the executing lines
Debugging facilities • Viewing and changing variable • Autos • displays variables used in the current statement and the previous statement • Locals • displays variables local to the current context. • Watch
Debugging Facilities • Call Stack • Breakpoints • Command Window • Execute Macro, such as Edit.Find • Immediate Window • Evaluate expression • Ouput
Get VS back when mixed up • VS.NET debugger does not start, set in Tools->Options, select Script
How script debugging works For those who are curiousabout what’s behind the debugger
Players in Debugging JavaScript • Script host (example: wscript.exe, mshtml.dll or asp.dll). This is the application that wants to run script. • Script engine (jscript.dll/vbscript.dll). This is responsible for interpreting the stream of script statements. • Process Debug Managed (pdm.dll). This is a dll written by the debugger team. It runs inside of the script process. • DCOM interface into the process. • Script Debug Engine.
Wrap up • You can debug JavaScript using MS Script Debugger or Visual Studio .NET. • Keyword "debugger “ is used to trigger the debugger. • Like many great software, Visual Studio .NET is a versatile tool. • Enjoy!