Hi BlueHazzard,
Thanks for your reply.
The code is as follows:
#include <iostream>
using namespace std;
int main()
{
int x = 3;
while (x==3)
{
cout << "X value is: " << x << endl;
cout << "New x value: " << endl;
cin >> x;
}
cout << "Loop terminated as condition is false" << endl;
return 0;
}
I put the breakpoint on the cout << "X value is: " << x << endl; line
I have turned on the full debug log as you said an this is the log of what I got:
#
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Documents and Settings\Daniel Travers\Desktop\5M0529\Teaching Modules\OOP\Random Programs\here\
Adding source dir: C:\Documents and Settings\Daniel Travers\Desktop\5M0529\Teaching Modules\OOP\Random Programs\here\
Adding file: C:\Documents and Settings\Daniel Travers\Desktop\5M0529\Teaching Modules\OOP\Random Programs\here\bin\Debug\here.exe
Changing directory to: C:/DOCUME~1/DANIEL~1/Desktop/5M0529/TEACHI~1/OOP/RANDOM~1/here/.
Set variable: PATH=.;C:\Dev-Cpp\bin;C:\Dev-Cpp;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;C:\Program Files\QuickTime\QTSystem;C:\j2sdk1.4.2_11\bin;C:\Program Files\Calibre2;c:\Program Files\Microsoft SQL Server\100\Tools\Binn;c:\Program Files\Microsoft SQL Server\100\DTS\Binn;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\Bin;C:\WINDOWS\system32\glut.h;C:\WINDOWS\system32\glut32.lib
[debug]Command-line: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet -args C:/DOCUME~1/DANIEL~1/Desktop/5M0529/TEACHI~1/OOP/RANDOM~1/here/bin/Debug/here.exe
[debug]Working dir : C:\DOCUME~1\DANIEL~1\Desktop\5M0529\TEACHI~1\OOP\RANDOM~1\here
Starting debugger: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet -args C:/DOCUME~1/DANIEL~1/Desktop/5M0529/TEACHI~1/OOP/RANDOM~1/here/bin/Debug/here.exe
done
[debug]> set prompt >>>>>>cb_gdb:
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
[debug]Reading symbols from C:\DOCUME~1\DANIEL~1\Desktop\5M0529\TEACHI~1\OOP\RANDOM~1\here\bin\Debug\here.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.5
[debug]Copyright (C) 2012 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law. Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "i686-pc-mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.5
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> source C:\Program Files\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory C:/DOCUME~1/DANIEL~1/Desktop/5M0529/TEACHI~1/OOP/RANDOM~1/here/
[debug]Source directories searched: C:/DOCUME~1/DANIEL~1/Desktop/5M0529/TEACHI~1/OOP/RANDOM~1/here;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Documents and Settings/Daniel Travers/Desktop/5M0529/Teaching Modules/OOP/Random Programs/here/main.cpp:11"
[debug]Breakpoint 1 at 0x4013c7: file C:/Documents and Settings/Daniel Travers/Desktop/5M0529/Teaching Modules/OOP/Random Programs/here/main.cpp, line 11.
[debug]>>>>>>cb_gdb:
[debug]> start
[debug]Temporary breakpoint 2 at 0x4013ba: file C:/Documents and Settings/Daniel Travers/Desktop/5M0529/Teaching Modules/OOP/Random Programs/here/main.cpp, line 7.
[debug]Starting program: C:\DOCUME~1\DANIEL~1\Desktop\5M0529\TEACHI~1\OOP\RANDOM~1\here\bin\Debug\here.exe
Child process PID: 5376
[debug][New Thread 5376.0x240]
[debug]Temporary breakpoint 2, main () at C:/Documents and Settings/Daniel Travers/Desktop/5M0529/Teaching Modules/OOP/Random Programs/here/main.cpp:7
[debug]C:\Documents and Settings\Daniel Travers\Desktop\5M0529\Teaching Modules\OOP\Random Programs\here\main.cpp:7:62:beg:0x4013ba
[debug]>>>>>>cb_gdb:
At C:\Documents and Settings\Daniel Travers\Desktop\5M0529\Teaching Modules\OOP\Random Programs\here\main.cpp:7
[debug]> info program
[debug] Using the running image of child Thread 5376.0x240.
[debug]Program stopped at 0x4013ba.
[debug]It stopped at a breakpoint that has since been deleted.
[debug]>>>>>>cb_gdb:
[debug]> step
[debug]C:\Documents and Settings\Daniel Travers\Desktop\5M0529\Teaching Modules\OOP\Random Programs\here\main.cpp:9:80:beg:0x4013c1
[debug]>>>>>>cb_gdb:
At C:\Documents and Settings\Daniel Travers\Desktop\5M0529\Teaching Modules\OOP\Random Programs\here\main.cpp:9
#
I constantly pressed the 'step into' button when the debugger is working. It constantly hops from my code to iostream code. The only way around it is if i press the'step into' button to debug a liine of my code and then press 'step out of' when it tries to debug the iostream code.