Skip to Main Content
Visual Studio Hacks
book

Visual Studio Hacks

by James Avery
March 2005
Intermediate to advanced content levelIntermediate to advanced
304 pages
19h 23m
English
O'Reilly Media, Inc.
Content preview from Visual Studio Hacks
Troubleshoot Breakpoints #37
Chapter 5, Debugging
|
149
HACK
default is to break always. You can, however, specify it to break when the hit
count equals, is a multiple of, or is greater than or equal to a specified value,
as shown in Figure 5-9.
With this setting, the breakpoint won’t cause the program to enter break
mode until it has been reached five times. The hit count technique is espe-
cially useful when you want to place a breakpoint within a loop, but are
interested in breaking only in specific cycles of the loop. For example, if you
wanted to break only after the loop had iterated a dozen times, you could set
the breakpoint to break only when its hit count was greater than or equal to
12. You could also configure the debugger to stop on each tenth iteration of
the loop by configuring the breakpoint to break only when its hit count is a
multiple of 10.
A large part of the life cycle of a computer program is testing and debug-
ging. Visual Studio’s powerful debugger enables developers to rapidly debug
applications. One of the most common tools used in debugging are break-
points. Breakpoints in Visual Studio can be added to specific lines of code or
particular functions and can be given conditions on when to break and how
often, based on a hit count.
—Scott Mitchell
HACK
#37
Troubleshoot Breakpoints Hack #37
Use an online web application to figure out why your breakpoints aren’t
working.
In “Set
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft Visual Studio 2015 Unleashed, Third Edition

Microsoft Visual Studio 2015 Unleashed, Third Edition

Mike Snell, Lars Powers
.Net Framework Essentials

.Net Framework Essentials

Thuan L. Thai, Hoang Lam
C# 5.0 Unleashed

C# 5.0 Unleashed

Bart De Smet
Programming .NET Security

Programming .NET Security

Adam Freeman, Allen Jones

Publisher Resources

ISBN: 0596008473Errata Page