🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.csharpbuilder.ide.editor
2 messages
2 total messages Started by Lambert Heenan Sun, 14 Nov 2004 14:48
Odd Watch behavior in the debugger
#1
Author: Lambert Heenan
Date: Sun, 14 Nov 2004 14:48
69 lines
2965 bytes
Here is a very simple console app., and below it the output. No surprises 
there but...

using System;

namespace TestDoodles
{
	
	class ClassTest
	{
		[STAThread]
		static void Main(string[] args)
		{
			//
			// TODO: Add code to launch test methods here
			//
			forWatchInDebug();
		}

	/// <summary>
	/// Observation on the behavior of C#Builder debugger
	/// </summary>
		static void forWatchInDebug()
		{
			const int LOOPMAX=3;

			for(int n=0;n<=LOOPMAX;n++)
				Console.WriteLine(n + " 1st loop ");
			Console.WriteLine("---");
			for(int n=0;n<=LOOPMAX;n++)
				Console.WriteLine(n + " 2nd loop ");
			Console.WriteLine("---");
			for(int n=LOOPMAX;n>=0;n--)
				Console.WriteLine(n + " 3rd loop ");
			Console.WriteLine("---");
		}
	}
}

Output:

0 1st loop
1 1st loop
2 1st loop
3 1st loop
---
0 2nd loop
1 2nd loop
2 2nd loop
3 2nd loop
---
3 3rd loop
2 3rd loop
1 3rd loop
0 3rd loop

If I set a breakpoint in each of the three for loops, and set a watch on 
each 'n' loop variable in each for loop and then step through this is 
what I see.

In the frist loop, the watch window shows all thee watch n's go from 0 to 
4 (on exiting the loop). While the 2nd and 3rd loops execute the watched 
value remains on 4.

If n is declared before the first foor loop and then the loops rewritten 
as "for( n=0;n<=LOOPMAX;n++)" etc. then I see the three watch values in 
lock step change in each loop. I guess that it is a namespace thing going 
on here, but it this a bug in the debugger not being able to watch like 
named objects?
Re: Odd Watch behavior in the debugger
#2
Author: Marc Rohloff TeamB
Date: Mon, 15 Nov 2004 02:03
15 lines
1720 bytes
On 14 Nov 2004 07:48:46 -0700, Lambert Heenan wrote:

Lambert,

It is against the newsgroup rules to cross-post. 5 groups is way more
than is necessary.

Secondly I would recommend you post bugs in QualityCentral
(qc.borland.com)

follow up set to borland.public.csharpbuilder.ide.debugger

-- 
Marc Rohloff [TeamB]
marc rohloff at myrealbox dot com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads