473,468 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Setting Breakpoints for Variables

Hi folks,
I am just learning C# and need some help with setting debugger
breakpoints. In VB 6, I could easily set breakpoints on variables
which either change in value or evaluate to a specific value. It
appears C# does not allow you to do this (at least not easily). This
functionality was extremely useful in many instances of VB 6
debugging.

Is there some way in which I can emulate this same functionality in
C#? I've tried various methods including throwing an exception base on
an evaluation of a variable. This does allow the program to break into
debugger at that point but does not allow you to continue.

Any guidance would be appreciated.
--
John Wood a.k.a Mortimer Schnurd
http://www.loosemarbles.com
Nov 15 '05 #1
2 1551
Are you looking for:

Trace.Assert (from System.Diagnostics) as in:

private void button1_Click(object sender, System.EventArgs e)
{
int iVar = 4;
Trace.Assert(iVar > 4, "This integer is less than five");
}

On Thu, 04 Mar 2004 11:14:59 -0500, Mortimer Schnurd
<fu**********@hotsmail.com> wrote:
Hi folks,
I am just learning C# and need some help with setting debugger
breakpoints. In VB 6, I could easily set breakpoints on variables
which either change in value or evaluate to a specific value. It
appears C# does not allow you to do this (at least not easily). This
functionality was extremely useful in many instances of VB 6
debugging.

Is there some way in which I can emulate this same functionality in
C#? I've tried various methods including throwing an exception base on
an evaluation of a variable. This does allow the program to break into
debugger at that point but does not allow you to continue.

Any guidance would be appreciated.


Nov 15 '05 #2
You might also be refering to break point properties....

Set a break point....then right click on the line and select break
point properties......

Dave

On Thu, 04 Mar 2004 11:14:59 -0500, Mortimer Schnurd
<fu**********@hotsmail.com> wrote:
Hi folks,
I am just learning C# and need some help with setting debugger
breakpoints. In VB 6, I could easily set breakpoints on variables
which either change in value or evaluate to a specific value. It
appears C# does not allow you to do this (at least not easily). This
functionality was extremely useful in many instances of VB 6
debugging.

Is there some way in which I can emulate this same functionality in
C#? I've tried various methods including throwing an exception base on
an evaluation of a variable. This does allow the program to break into
debugger at that point but does not allow you to continue.

Any guidance would be appreciated.


Nov 15 '05 #3

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

Similar topics

1
by: Rodger Dusatko | last post by:
In VB .NET I am having problems setting breaks. I want the break to be independant of any single function: for example: err.number or global variables When I try to set a break with the 'Data'...
2
by: MSK | last post by:
Hi, Continued to my earlier post regaring "Breakpoints are not getting hit" , I have comeup with more input this time.. Kindly give me some idea. I am a newbie to .NET, recently I installed...
1
by: jeem | last post by:
I am using ActiveState Komodo 3.5 to work on a large python 2.4 application with an extensive UI... I am attempting to debug the application and am setting breakpoints in 4 different *.py files.....
5
by: Jerry Spence1 | last post by:
In VB6 you could set a breakpoint when a variable had changed value. I can't find this in VB2005. Is it there somewhere? -Jerry
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
3
by: Ronald Raygun | last post by:
I have some server side code I want to debug (coming from C++ background). I am using echo statements but for some reason, no output is being generated. It would be much simpler if I could set...
6
by: PeteOlcott | last post by:
When I set a break point in a file that has both managed C++ and unmanaged C++ the debugger never sees the breakpoints in the managed code. What can be done to get the debugger to "see" the...
0
by: PeteOlcott | last post by:
When I set a break point in a file that has both managed C++ and unmanaged C++ the debugger never sees the breakpoints in the managed code. What can be done to get the debugger to "see" the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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 ...

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.