473,657 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inserting Breakpoint at Runtime

I need to loop through a method 599 times, then break at the 600th loop in
the debugger.

Can I do that in code?

--
Regards,

Fred Chateau
http://hotelmotelnow.com
Jun 5 '07 #1
4 1973
Yup, conditional break :
type a boolean expression such as "i == 600" on the breakpoint (visual
studio 2005)
>I need to loop through a method 599 times, then break at the 600th loop in
the debugger.

Can I do that in code?

--
Regards,

Fred Chateau
http://hotelmotelnow.com

Jun 5 '07 #2
On Tue, 05 Jun 2007 09:37:34 -0700, Fred Chateau
<we*******@hote lmotelnow.comwr ote:
I need to loop through a method 599 times, then break at the 600th loop
in
the debugger.

Can I do that in code?
You can write code that checks your loop counter and then calls
Debugger.Break( ). Or you can simply set a conditional breakpoint in the
debugger, that checks the loop counter and only breaks at a specific line
when the counter matches the condition you specify.

Pete
Jun 5 '07 #3
You can customize the breakpoint by right clicking on the red dot
Jun 5 '07 #4

"Fred Chateau" <we*******@hote lmotelnow.comwr ote in message
news:Oy******** ******@TK2MSFTN GP04.phx.gbl...
>I need to loop through a method 599 times, then break at the 600th loop in
the debugger.

Can I do that in code?
if (i == 600) global::System. Diagnostics.Deb ugger.Break();
>
--
Regards,

Fred Chateau
http://hotelmotelnow.com


Jun 5 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2424
by: Marko Poutiainen | last post by:
Situation: We had to make our SQLServer 2000 database multi-lingual. That is, certain things (such as product names) in the database should be shown in the language the user is using (Finnish, Swedish or English). There are about a dozen tables with columns that need localization. Doing this in the application level was a no-goer. It would have taken far too much time (there is a *lot* of code and unfortunately most of the...
1
7456
by: Mike | last post by:
Can someone please tell me why this code (it is a function that has a parameter xmlstring: Dim objWebRequest As HttpWebRequest Dim oRequest As WebRequest objWebRequest = CType(WebRequest.Create("https://anon:6442"), HttpWebRequest) objWebRequest.Method = "POST" objWebRequest.ContentType = "text/xml" Dim PostBuffer As Byte() = System.Text.Encoding.GetEncoding(65001).GetBytes(XmlString)
1
1968
by: manish | last post by:
Hi, I am a fresher in the programming field i.e although I have done programming at the basic level but at professional level I am very new and I am facing many problems. These probllems are not taughtand I am not getting any Refrences to cope with them. ********Setting in VC++ 6.0 I don'know to apply setting for various/different projects. I am not getting basics out of it .Can u pls tell me how to make a good understanding of...
3
6896
by: Joachim Klassen | last post by:
Hi all, first apologies if this question looks the same as another one I recently posted - its a different thing but for the same szenario:-). We are having performance problems when inserting/deleting rows from a large table. My scenario: Table (lets call it FACT1) with 1000 million rows distributed on 12
7
1822
by: AC [MVP MCMS] | last post by:
Wierd situation here. Running ASP.NET 1.1 on Win2003. I have to manually attach the debugger to a process in order to debug. So I set a breakpoint in an obvious place (like within the Page.Load event) that will catch it. For Win2003, I attach to the w3wp.exe process. I've made sure my project is building as DEBUG. I've made sure the breakpoint it reachable. I've made sure my web.config has debug=true. But when I run through the...
5
1197
by: MLH | last post by:
Will it screw me up in a runtime rollout? If I forget about and leave a breakpoint set in A97, encrypte it, then compile it to an mde and roll it out in a runtime environment - will the app remember it and continue to halt at those breakpoints?
0
3176
by: noleander | last post by:
Hi. Ive been using Visual C++ for two years on an application. The application is one solution, containing 10 projects. 9 of the projects build libraries (*.lib). I've been debugging the application for 2 years. One thing that has been happening for several months is a genuine mystery: I cannot set breakpoints in one of the libraries (source code). I can create the breakpoint in the source code editor, but when I attach to the...
4
5521
by: TC | last post by:
When I try to debug my code, Visual Studio is skipping my breakpoints. At runtime, the solid red circle becomes only the outline of a circle, and if I hover over the breakpoint I see the message "The breakpoint will not currently be hit. No symbols have been loaded for this document." Breakpoints seem to be functional in the startup project, but nowhere else. I've found that I can hit a breakpoint in the startup project, then step...
6
1619
by: Bruce | last post by:
I have a reference assembly that I wrote. The assembly can throw exceptions. I am handling these exceptions but, when running my code from VB, VB still insists on setting a breakpoint where the exception is being thrown inside the assembly. Is there anyway to avoid this? If so how?
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.