473,379 Members | 1,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

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::ResultType::const_iterator ResultIt =
ShowAll.getResults().begin(); ResultIt != ShowAll.getResults().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 1051
>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
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. ...
2
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:...
13
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...
11
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...
3
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...
0
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...
1
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...
4
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...
5
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.