473,803 Members | 2,946 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Variable not Showing in Debugger

Can anyone tell me why j never shows up in my locals window? 32 is
printed to console so I know the assignment is working. I was under the
impression that I could see everything as it happens by setting a
breakpoint then F11 on through the code. Kind of disturbing that j never
shows up, (regardless of where I set my breakpoint) as it makes me
wonder what else I'm not seeing. Is there a 'show everything' debugger
option or something I'm missing? BTW, I'm using the 'Express' version of
Visual Studio.

public class Tester
{
* static int j = 32;
static void Main()
* {
Console.WriteLi ne(j);
Time t1 = new Time( currentTime );
t1.DisplayCurre ntTime();

Time t2 = new Time( 2007, 9, 18, 11, 45 );
t2.DisplayCurre ntTime();

Time t3 = new Time();
t3.DisplayCurre ntTime();
}
}

//* = breakpoints

Thanks in advance,

Jack
Aug 13 '08
12 6048
Peter Duniho wrote:
On Wed, 13 Aug 2008 16:34:37 -0700, Arcticool <ar*******@hotm ail.com>
wrote:
>[...]
I just thought that the debugger could show everything that's
happening in the code as you step through. If it is only selectively
showing me information, I wonder what else I'm *not* seeing.

Well, one other obvious thing missing from Express is the lack of
threaded debugging. That is, you can debug any thread in Express, but
it has no UI for switching your view from one thread to another.

Express is a limited version of Visual Studio. It stands to reason that
there will be things it doesn't show you.
>Now I'm also wondering if 'Express' is as good of a learning tool as
the other versions...

If the Express version had all of the features that the retail versions
had, there wouldn't be much point in the retail versions, would there?
And surely the determining factor for what features make it into the
Express version and what features don't is not strictly "which ones
support the IDE as a learning tool?" That is, obviously given that some
features are missing in the Express version, some of the missing
features would be ones that are useful for learning.

In other words, I have no idea why you would expect that the free
version of Visual Studio be every bit as effective a "learning tool" as
the retail version, at least with respect to your apparent implication
that features in the IDE equate to it being a "learning tool"
(personally, I think that one of the things that may help the Express
version be a good learning tool is the relative simplicity, leaving out
features that could confuse a beginning programmer).

Now, all that said...I'm still surprised that it doesn't have the
"Autos" window. I've used the Express version in the past, and that's
the sort of feature that I'd think I'd notice if it were missing. But I
guess I'll take your word for it that that's one of the features that's
been left out of the Express version (I definitely don't care enough to
install the thing now just to check :p ).

But surely this is not a critical feature for being able to use the
debugger as a "learning tool". It's really only a matter of slight
inconvenience. It's not like the debugger won't let you see whatever
variables you want to see. You just need to be a bit more explicit
about it.

Pete
Well free is free so I guess I can't complain, just a little surprised
this feature is missing. Apparently there is quite a bit more missing as
well:
http://msdn.microsoft.com/en-us/vstu.../cc149003.aspx
http://www.programmingforums.org/post146811.html

It looks like the 2005 Express was missing the Watch window, but had
Autos, now in the 2008 edition its reversed.
Anyway, the good news is that items added to the Watch window are saved
with the project. If I close VS then re-open the Watched items
previously added are still there.

Jack
Aug 14 '08 #11
On Aug 14, 3:34*am, Arcticool <arctic...@hotm ail.comwrote:
I just thought that the debugger could show everything that's happening
in the code as you step through.
For one thing, the code sample you've posted doesn't even use the
variable you're interested in, so why should the debugger bother
showing it? I doubt it would be displayed even if you could enable the
"Autos" window. If you at least had an instance of your class, and
called a method on it, then "this" would've show in "Locals", and you
could expand it and see the static variables in a separate node
under it.

And, of course, the debugger cannot just show you all values of all
static variables in a program at all times - for anything above
HelloWorld, it would quickly become unwieldy.
Aug 14 '08 #12
Pavel Minaev wrote:
On Aug 14, 3:34 am, Arcticool <arctic...@hotm ail.comwrote:
>I just thought that the debugger could show everything that's happening
in the code as you step through.

For one thing, the code sample you've posted doesn't even use the
variable you're interested in, so why should the debugger bother
showing it? I doubt it would be displayed even if you could enable the
"Autos" window. If you at least had an instance of your class, and
called a method on it, then "this" would've show in "Locals", and you
could expand it and see the static variables in a separate node
under it.
When you say the variable J is not 'used' you mean the variable isn't
modified? J is assigned to 32. Also it is used on Console.Writeli ne(J);
So 'stuff' is happening with J, but not much I guess...
And, of course, the debugger cannot just show you all values of all
static variables in a program at all times - for anything above
HelloWorld, it would quickly become unwieldy.
I don't really want to see everything at once, just what is happening as
it happens. If something changes ( J gets assigned to 32 or J is written
out ) I'd like the debugger to show me what's happening as I hit F11.

But I think the real issue is that I'm using the Express version of VS
which has no Autos window, which would have shown me these things. I've
done a bit of searching however and haven't seen anything better than VS
Express (not Windows based anyway) so I'm wondering now if I would be
better off with an older (full retail) of VS 2003? With the patches and
updates will I be better off or worse?
Thanks,

Jack
Aug 15 '08 #13

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

Similar topics

1
1687
by: IC | last post by:
Hello, When debugging a SQL sproc in VS.NET, is there a way to get the debugger to retrieve the full value of a SQL variable if its content is longer than 256 characters? I currently have a SQL variable of type TEXT, its content is roughly 1000 characters. When stepping through the sproc in the debugger only 256 character are displayed in the watch windows and same thing with the Immediate Command Window.
6
1151
by: VMI | last post by:
I have a really simple IF statement that looks like this: if (sNewString.Length == iCount) { MessageBox.Show (sNewString.Length.ToString() + " is equal to " + iCount.ToString() + "*" + sNewString + "*"); } if (sNewString.Trim() == "") { MessageBox.Show ("");
4
1510
by: Ryan Gaudet | last post by:
Hi, I'm making some minor changes to a VB 6 app that I converted to VB .NET a couple of years ago and I'm running into an issue with a function that is seemingly returning a different result in the debugger than when I run the exe. The code in question is this; iniFileName = Replace(System.Reflection.Assembly.GetExecutingAssembly.Location, ".exe", "") & ".ini"
0
1176
by: Michael R | last post by:
Here's one that's got me stumped... I have a class with a member variable. I set it in a member method. In the debugger, it shows up as <undefined> before AND AFTER it is set. However, after it is set, I set a property of the newly initialized member. Even though the debugger says that the value is undefined, there is no run-time error. I call another class method and pass the member variable by 'ref'. The
3
2699
by: Vagif Abilov | last post by:
I investigate further the problem I reported earlier as incorrectly set values of static variable instances. Actually it is reproduced with a little piece of code. I made a simlpe Web site consisting of an empty page. The page C# code file looks like this: using System; using System.Web;
4
5946
by: aramsey | last post by:
I have a javascript program that works fine under Firefox and on IE when running XP, but is having a problem with IE running under Windows 2000 Pro. On my personal XP development machine I have the Microsoft Script Editor and I can set a breakpoint, step through code, inspect variables, etc... with no problem. On a machine where I am trying to debug this problem I am running Windows 2000 Pro with IE 6. I installed the Microsoft...
2
1712
by: Joanna Carter [TeamB] | last post by:
Hi folks If I write a KeyDown handler and check the KeyCode for Keys.Insert, the debugger shows the value as Keys.LButton | Keys.MButton | Keys Back | Keys.Space. This is perfectly understandable since Keys.Insert = 45 and 1 + 4 + 8 + 32 also equals 45. However, it would be really nice if the debugger showed both the combined value as well as the Flags attribute split value.
5
2284
by: Max2006 | last post by:
Hi, I am using Visual C# 2005 and I like to setup breakpoint that pause execution upon a class variable change. Is that possible?
3
1380
by: call_me_anything | last post by:
Hi, How do I stop the debugger (ddd or even gdb will do) when a global variable (or a static variable in a function) gets modified ? Adding a watch on the variable only tells that the variable has changed but not how.
0
10555
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10317
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10300
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9127
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7607
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4277
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 we have to send another system
3
2974
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.