Skip to main content
GameDev.net gamedev.net
🔒 Locked

Borland C++ Builder 6.0 Debug does not function properly

Started by JohnsonGPS Feb 1, 2007 at 12:37 PM 0 replies 1.1k views
Original Post
JohnsonGPS
JohnsonGPS
Hi there, I am a brand new C++ Builder 6.0 user, and I could not figure out why the debug function never work as expected. I compiled the following lines and debug it in C++ Builder: int iTest = 1; ---- Line 1 if (iTest > 5) ---- Line 2 iTest ++; ---- Line 3 printf ("%d", iTest ); ---- Line 4 To my surprise, line 2 always meets the condition, and the cursor moves into line 3. To be even more wierd, the cursor skips line 4 after pressing F8 for stepover again. However, although the cursor moves into line 3 after pressing F8 for stepover,line 3 is actually not executed, while line 4 is actually executed by examing the value. So obviously the IDE cheated my eye. Does anybody encounter this problem as well? Johnson
tag
tag
If you have optimizations on, the compiler will rearrange the code to make it run faster. Stepping through the source code is then a problem. Make sure you are in Debug mode with optimizations off.

T.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.