Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2004

Tip: Looking for answers? Try searching our database.

Weird debug behaviour

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Val - 24 May 2004 00:39 GMT
In vc7 (studio 2002), when I try to debug the first "if" statement, the IDE jumps to the next valid line and evaluates it even
if the if-statement is false. What is going on?

if( (theDealer.m_nPoints == 15) && (theDealer.Hand.size() == 2) ) //Break Point set here but...
{
vector<Card>::iterator vdi; // ... runs to here once debugging starts. Even if false is returned initially.
vdi = find_if( theDealer.Hand.begin(), theDealer.Hand.end(), SpecificValueCheck(14) );
if (vdi != theDealer.Hand.end())
return true;
}
B0nj - 24 May 2004 19:28 GMT
Check that it's not in 'release' mode. You can still debug in release mode,
but weird things will happen. It doesn't necessarily mean that in Release
mode it would take a 'shortcut' to there once the if statement had been
evaluated, and would jump into the if block regardless - it simply means the
debugger hasn't got a clue what's going on as the exe may be optimized and
hasn't got pdb symbols in it.

> In vc7 (studio 2002), when I try to debug the first "if" statement, the IDE jumps to the next valid line and evaluates it even
> if the if-statement is false. What is going on?
[quoted text clipped - 6 lines]
> return true;
> }
Val - 25 May 2004 00:11 GMT
| Check that it's not in 'release' mode. You can still debug in release mode,
| but weird things will happen. It doesn't necessarily mean that in Release
[quoted text clipped - 17 lines]
| > return true;
| > }

Hmm, this was a VC6 project containing STLport 4.6.2, ported to VC7. What I did was deleting all files except for the
source/headers. Then I created a new managed C++ project from start. Now it works again.
I don't know why the debugger didn't have a clue.

Thank you for your help, much appreciated!

- Val -
Beeeeeves - 12 Jun 2004 14:20 GMT
It does have a habit of getting itself confused, often simply restarting the
IDE can have the same effect.

> | Check that it's not in 'release' mode. You can still debug in release mode,
> | but weird things will happen. It doesn't necessarily mean that in Release
[quoted text clipped - 25 lines]
>
> - Val -

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.