By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 2,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

Data Based breakpoints..

P: n/a
Does anyone know why some genius decided that data based breakpoints are not
supported in C#/ vb.net debugging?
Is there some technical reason Or has it been done to make breakpointing
more fustrating than ever?

--
Br,
Mark Broadbent
mcdba , mcse+i
=============
Nov 16 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Mark Broadbent" wrote :
Does anyone know why some genius decided that data based breakpoints are not supported in C#/ vb.net debugging?
Is there some technical reason Or has it been done to make breakpointing
more fustrating than ever?


Can't you use the breakpoint condition ? What do you exactly need ?

--
Francois Beaussier
Fr******@3ie.org.remove
Nov 16 '05 #2

P: n/a
I would prefer to have been able to do the data breakpoint, but I have been
trying and failing to get the condition /has changed to work. This may be my
stupidity *but* the documentation for this is very sparse and does not give
me a working example. I can get the "is true" condition to work fine but not
the has changed. If you can give my a sample code and what I should put in
the condition for the has changed condition I will be grateful. Otherwise my
foot is going through this Screen.

Thx

--
Br,
Mark Broadbent
mcdba , mcse+i
=============
"Francois Beaussier" <Fr******@3ie.org.invalid> wrote in message
news:OK**************@TK2MSFTNGP10.phx.gbl...
"Mark Broadbent" wrote :
Does anyone know why some genius decided that data based breakpoints are

not
supported in C#/ vb.net debugging?
Is there some technical reason Or has it been done to make breakpointing
more fustrating than ever?


Can't you use the breakpoint condition ? What do you exactly need ?

--
Francois Beaussier
Fr******@3ie.org.remove

Nov 16 '05 #3

P: n/a
"Mark Broadbent" wrote :
I would prefer to have been able to do the data breakpoint, but I have been trying and failing to get the condition /has changed to work. This may be my stupidity *but* the documentation for this is very sparse and does not give me a working example. I can get the "is true" condition to work fine but not the has changed. If you can give my a sample code and what I should put in
the condition for the has changed condition I will be grateful. Otherwise my foot is going through this Screen.


Lets try :)

Create a new Console application.
Copy paste the following in Class1.cs

---8<---
using System;
namespace ConsoleApplication1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int i = 0, j = 0;
while (true)
{
Console.WriteLine("{0} {1}", i, j);
if (j > 50)
{
i++;
}
j++;
}
}
}
}
---8<---

Put a breakpoint on the Console.WriteLine(...) statement
Go in the properties for this breakpoint and set the condition to "i"
and select "has changed".

Compile and run. The application will only break when i has changed
ie at the 50th Console.WriteLine(...)

Does that suit your needs ?

--
Francois Beaussier
Fr******@3ie.org.remove
Nov 16 '05 #4

P: n/a
You may use
System.Diagnostics.Debugger.Break();

"Mark Broadbent" <no************@no-spam-please.com> wrote in message
news:OZ****************@TK2MSFTNGP10.phx.gbl...
Does anyone know why some genius decided that data based breakpoints are not supported in C#/ vb.net debugging?
Is there some technical reason Or has it been done to make breakpointing
more fustrating than ever?

--
Br,
Mark Broadbent
mcdba , mcse+i
=============

Nov 16 '05 #5

P: n/a
merci Francois. That worked how I expected, do not know why it wasnt working
for me, but seems to work fine now. It would be nice to be able to set a
break on the change of variable (i.e. not dependant upon a particular line)
but at least this now works as I expected. (really dont know where I was
going wrong because I could have sworn I was doing this in my code)

Anyway Thanks again. :)

--
Br,
Mark Broadbent
mcdba , mcse+i
=============
"Francois Beaussier" <Fr******@3ie.org.invalid> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
"Mark Broadbent" wrote :
I would prefer to have been able to do the data breakpoint, but I have been
trying and failing to get the condition /has changed to work. This may be my
stupidity *but* the documentation for this is very sparse and does not give
me a working example. I can get the "is true" condition to work fine but

not
the has changed. If you can give my a sample code and what I should put

in the condition for the has changed condition I will be grateful.

Otherwise my
foot is going through this Screen.


Lets try :)

Create a new Console application.
Copy paste the following in Class1.cs

---8<---
using System;
namespace ConsoleApplication1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int i = 0, j = 0;
while (true)
{
Console.WriteLine("{0} {1}", i, j);
if (j > 50)
{
i++;
}
j++;
}
}
}
}
---8<---

Put a breakpoint on the Console.WriteLine(...) statement
Go in the properties for this breakpoint and set the condition to "i"
and select "has changed".

Compile and run. The application will only break when i has changed
ie at the 50th Console.WriteLine(...)

Does that suit your needs ?

--
Francois Beaussier
Fr******@3ie.org.remove

Nov 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.