473,698 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mysterious values in IDE when debugging

Hi,

I recently started using VC7.1 (upgraded from VC6). I've noticed that
when stepping through code, some of the values of my variables make no
sese at all. For instance, I had some code like this:

int i = 1, j =1 ;
for ( MyClass::Result Type::const_ite rator ResultIt =
ShowAll.getResu lts().begin(); ResultIt != ShowAll.getResu lts().end();
++ResultIt, i++ ) {
.......
cout << "Value of i is : " << i << endl ;
When I hovered my mouse ptr over the variable i, in the 'for'
expression, I got a nonsensical number: 2012749653 - however the value
printed on the console was correct.

When I "dragged" the variable named i to the watch window, I got the ff
error message: "i CXX0069: Error: variable needs stack frame", and this
was still within the for loop, so the i variable must have still been on
the stack - any body care to shed some light on wtf is going on?

Thanks

Nov 17 '05 #1
3 1063
>I recently started using VC7.1 (upgraded from VC6). I've noticed that
when stepping through code, some of the values of my variables make no
sese at all. For instance, I had some code like this:
...
When I hovered my mouse ptr over the variable i, in the 'for'
expression, I got a nonsensical number: 2012749653 - however the value
printed on the console was correct.


Alfonzo,

Are you debugging a release optimised build rather than the debug
non-optimised build? The results you mentioned are typical when
debugging optimised builds.

Dave
Nov 17 '05 #2


David Lowndes wrote:
I recently started using VC7.1 (upgraded from VC6). I've noticed that
when stepping through code, some of the values of my variables make no
sese at all. For instance, I had some code like this:
...
When I hovered my mouse ptr over the variable i, in the 'for'
expression, I got a nonsensical number: 2012749653 - however the value
printed on the console was correct.

Alfonzo,

Are you debugging a release optimised build rather than the debug
non-optimised build? The results you mentioned are typical when
debugging optimised builds.

Dave


Hi Dave,

Thanks for reply - but no, this was my own code that I was running in
debug mode.

Nov 17 '05 #3
>> Are you debugging a release optimised build rather than the debug
non-optimised build? The results you mentioned are typical when
debugging optimised builds.

Thanks for reply - but no, this was my own code that I was running in
debug mode.


Have you checked the compiler optimisation setting is set to /Od for
the source file(s)/project in question?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #4

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

Similar topics

1
1297
by: Shai Zohar | last post by:
We have encountered the following problem with DOT.NET 2003 development environment. Sometimes while debugging, we the environment does not display the values of DateTime variables and fields. Instead of the values, the environment displays the wording "{System.DateTime}", and instead of the properties of DateTime variables, the environment displays "error: cannot obtain value". We have copied the screens that display these messages...
2
1397
by: J. Yuan | last post by:
Hi, I am having some problems getting combo boxes to work right. I'm trying to get a combo box to select all the distinct "invoice numbers" in a table by using the following SQL statement: "SELECT DISTINCT TblStock. FROM TblStock;" I tested this statement by creating a new Query, and it worked fine. But when I put this statement into the "row source" of my combo box, it doesn't work. When I click on it, it displays nothing. What's...
13
2432
by: Max | last post by:
Hi There! I'm having a mysterious error right after I login using Forms Authentication in my ASP.NET app. Below is the error... Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. The exception throws at the code that tries to set a property (String data type) at my Menu user control.
11
37025
by: serge | last post by:
When i debug a trigger is it possible to add a WATCH on the INSERTED or DELETED? I think not, at least I couldn't figure out a way to do so. Does someone have a suggestion on how I can see the values? I did try to do something like INSERT INTO TABLE1(NAME) SELECT NAME FROM INSERTED
3
2149
by: David Mathog | last post by:
This one is driving me slightly batty. The code in question is buried deep in somebody else's massive package but it boils down to this, two pointers are declared, the first is: char **resname which is part of the "atoms" structure that is passed into the function from the outside. I have not yet found where it is allocated but I'm reasonably sure from other chunks of this code that it was by:
0
1330
by: ManConfusedByMouse | last post by:
Hi all, I AM HAVING PROBLEMS UNDERSTANDING THE UPDATING BEHAVIOR/TIMING OF A WINDOWS.FORMS.SCROLLBAR COMPONENT... quick apology for my sorry posterior if posting in wrong place -- haven't much experience with these groups, and can find nothing more specific than csharp. my program manually sets up some synchronization between the user's mouse , some bitmaps viewable on container's surface
1
1281
by: webmaster | last post by:
Dumb Noob question for sure. I've looked for the answer in two intro books and a cbt, and maybe I'm just missing it. I see when I do an F5 to debug and run my code ( a simple console application for my example), that several windows pop-up.. one of them reads "auto". How can display variables and their "current" values while I step
4
2109
by: _MC_ | last post by:
Hi, I'm unable to access values in my Datagrid. Datagrid thinks it hase only 1 Cell. So here it is: The Datagrid is binded in PageLoad, AutoGenerateColumns is false, Columns are added on PageLoad like this: BoundColumn Bound_Column = new BoundColumn(); Bound_Column.DataField = name; ( + HeaderText,
5
1402
by: david | last post by:
I have a picture and it has onclick event, with invokes JavaScript function called ModuleManager(); Then it saves a copy of Node (Blocks, which is DIV) it tmp_blocks with all children elements. And it changes Blocks innerHTML with new one, which has form and after I press button which has onclick too and calls another function which Blocks innerHTML sets to tmp_blocks; But after that(when I want to press image again) FireFox says:...
0
8675
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9160
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
8862
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...
1
6521
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
4370
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
3050
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
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
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.