Data Based breakpoints..

  • Thread starter Thread starter Mark Broadbent
  • Start date Start date
M

Mark Broadbent

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
=============
 
:
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 ?
 
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
=============
 
:
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 ?
 
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 said:
:
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 ?
 
Back
Top