Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: zhelunwu on October 26, 2013, 06:00:30 am

Title: Why is that the case?
Post by: zhelunwu on October 26, 2013, 06:00:30 am
After I have toggled two breakpoints in my program and tryna debug,  it just go all the way down and finish the program

Indeed, I have never seen once when it could!!

But dev-cpp works well, I just feel puzzled.
 ??? ??? ???
And here follows the info in debugger:

Building to ensure sources are up-to-date
Selecting target:
Debug

Set variable: PATH=.;D:\Program Files\CodeBlocks\MinGW\bin;D:\Program Files\CodeBlocks\MinGW;C:\Program Files\NVIDIA Corporation\PhysX\Common;D:\Program Files\CodeBlocks\MinGW\libexec\gcc\mingw32\4.7.1;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;D:\CTEX\UserData\miktex\bin;D:\CTEX\MiKTeX\miktex\bin;D:\CTEX\CTeX\ctex\bin;D:\CTEX\CTeX\cct\bin;D:\CTEX\CTeX\ty\bin;D:\CTEX\Ghostscript\gs9.05\bin;D:\CTEX\GSview\gsview;D:\CTEX\WinEdt;C:\Program Files\Windows Kits\8.0\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;D:\Program Files\QuickTime\QTSystem;E:\Program Files\MATLAB\R2013a\runtime\win32;E:\Program Files\MATLAB\R2013a\bin
Starting debugger: D:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname  -quiet  -args /bin/Debug/hello.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Reading symbols from \Debug\hello.exe...(no debugging symbols found)...done.
Debugger name and version: GNU gdb (GDB) 7.5
Child process PID: 7772
[Inferior 1 (process 7772) exited normally]
Debugger finished with status 0
Title: Re: Why is that the case?
Post by: Jenna on October 26, 2013, 07:38:28 am
After I have toggled two breakpoints in my program and tryna debug,  it just go all the way down and finish the program
[...]
Reading symbols from \Debug\hello.exe...(no debugging symbols found)...done.
[...]

It looks like you try to debug a release-project.
Make sure the debug switch is set while compiling, if you use MinGW/gcc it's -g .

And please use code-tags, if you post log-output or sources to make it more readable.
Title: Re: Why is that the case?
Post by: zhelunwu on October 26, 2013, 08:24:37 am
Code
#include<iostream>
using namespace std;
int main()
{
    int n = 5;
    cout << "Hello world!"<<endl;
    cout << n << endl;
    return 0;
}

just a test program, but I fail to track anyway, it just go until the last line and no yellow triangle appears

yeah, i mean the breakpoints are not effective
Title: Re: Why is that the case?
Post by: Jenna on October 26, 2013, 08:44:35 am
Why do you ask questions in a forum, if you do not read the answers ?

Reread my previous post, everything you need is written there !
Title: Re: Why is that the case?
Post by: oBFusCATed on October 26, 2013, 11:28:34 am
http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks