Home All Groups Group Topic Archive Search About

Programmable breakpoints?

Author
3 Apr 2005 10:21 AM
John Dann
I guess there's no such thing as programmable breakpoints? I'm trying
to debug a program that has a problem deep inside a long loop, eg at
iteration 2000 of around 4000, which makes it realistically impossible
to step through manually. I'd like to be able to say:

If i = 300 then Break

and then start single stepping to find out variable values and the
fault in the logic. But it doesn't seem to exist. Is there any
alternative? (I can't start the loop at a later value for test
purposes because the data flow isn't known at design time.)

JGD

Author
3 Apr 2005 10:41 AM
Stephany Young
If i = 300 Then
    Console.WriteLine("xxx")
End If

Set a breakpoint on the Console.WriteLine("xxx") line and voila!


Show quoteHide quote
"John Dann" <n***@prodata.co.uk> wrote in message
news:lggv41d49id8c56og4842beupj4quik0o9@4ax.com...
>I guess there's no such thing as programmable breakpoints? I'm trying
> to debug a program that has a problem deep inside a long loop, eg at
> iteration 2000 of around 4000, which makes it realistically impossible
> to step through manually. I'd like to be able to say:
>
> If i = 300 then Break
>
> and then start single stepping to find out variable values and the
> fault in the logic. But it doesn't seem to exist. Is there any
> alternative? (I can't start the loop at a later value for test
> purposes because the data flow isn't known at design time.)
>
> JGD
Author
3 Apr 2005 11:46 AM
Herfried K. Wagner [MVP]
"John Dann" <n***@prodata.co.uk> schrieb:
>I guess there's no such thing as programmable breakpoints? I'm trying
> to debug a program that has a problem deep inside a long loop, eg at
> iteration 2000 of around 4000, which makes it realistically impossible
> to step through manually. I'd like to be able to say:
>
> If i = 300 then Break

\\\
If i = 300 Then Stop
///

Alternatively you can set a breakpoint on a line, right-click it, choose
"Breakpoint properties..." from its context menu and add a condition.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
3 Apr 2005 4:03 PM
Michael D. Ober
Do you have:

Debug.Assert

in the VB 7.x IDE?  If not, just another reason I'm staying with VB 6 until
VB 8 is released.

Mike Ober.



Show quoteHide quote
"John Dann" <n***@prodata.co.uk> wrote in message
news:lggv41d49id8c56og4842beupj4quik0o9@4ax.com...
> I guess there's no such thing as programmable breakpoints? I'm trying
> to debug a program that has a problem deep inside a long loop, eg at
> iteration 2000 of around 4000, which makes it realistically impossible
> to step through manually. I'd like to be able to say:
>
> If i = 300 then Break
>
> and then start single stepping to find out variable values and the
> fault in the logic. But it doesn't seem to exist. Is there any
> alternative? (I can't start the loop at a later value for test
> purposes because the data flow isn't known at design time.)
>
> JGD
Author
3 Apr 2005 5:12 PM
Herfried K. Wagner [MVP]
"Michael D. Ober" <ober***@.alum.mit.edu.nospam> schrieb:
> Do you have:
>
> Debug.Assert
>
> in the VB 7.x IDE?  If not, just another reason I'm staying with VB 6
> until
> VB 8 is released.

'Debug.Assert' is supported in VS.NET 2002 and 2003.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
3 Apr 2005 9:36 PM
Michael D. Ober
Then this the solution to OPs problem of putting a breakpoint in.

Mike.

Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:uf9jHAHOFHA.2252@TK2MSFTNGP15.phx.gbl...
> "Michael D. Ober" <ober***@.alum.mit.edu.nospam> schrieb:
> > Do you have:
> >
> > Debug.Assert
> >
> > in the VB 7.x IDE?  If not, just another reason I'm staying with VB 6
> > until
> > VB 8 is released.
>
> 'Debug.Assert' is supported in VS.NET 2002 and 2003.
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>
>
>
Author
4 Apr 2005 8:50 PM
Herfried K. Wagner [MVP]
"Michael D. Ober" <ober***@.alum.mit.edu.nospam> schrieb:
> Then this the solution to OPs problem of putting a breakpoint in.

Yes, 'Debug.Assert' would work too.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>