I wrote this short program and put it into a codeblocks project:
#include <iostream>
using namespace std;
int main()
{
char c;
cin>>c;
cout<<c;
}
I added a breakpoint to line 7, rebuilt the project, and clicked debug. The debugger started and skipped over the breakpoint, automatically quitting.
I am running codeblocks 17.12. In compiler options [-g] is enabled and [-s] is disabled
Here is the Debug log:
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /home/yaxollum/yax/cpp/proj/
Adding source dir: /home/yaxollum/yax/cpp/proj/
Adding file: /home/yaxollum/yax/cpp/proj/bin/Debug/proj
Changing directory to: /home/yaxollum/yax/cpp/proj/.
Set variable: LD_LIBRARY_PATH=.:
[debug]Command-line: /usr/bin/gdb -nx -fullname -quiet -args /home/yaxollum/yax/cpp/proj/bin/Debug/proj
[debug]Working dir : /home/yaxollum/yax/cpp/proj
Starting debugger: /usr/bin/gdb -nx -fullname -quiet -args /home/yaxollum/yax/cpp/proj/bin/Debug/proj
done
[debug]> set prompt >>>>>>cb_gdb:
Setting breakpoints
[debug]Reading symbols from /home/yaxollum/yax/cpp/proj/bin/Debug/proj...
[debug]Using terminal's PID as console PID 16553, TTY /dev/tty2
[debug]Queued:[tty /dev/tty2]
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
[debug]Copyright (C) 2018 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 "x86_64-linux-gnu".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
[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 200
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory /home/yaxollum/yax/cpp/proj/
[debug]Source directories searched: /home/yaxollum/yax/cpp/proj:$cdir:$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "/home/yaxollum/yax/cpp/proj/hello.cpp:7"
[debug]Breakpoint 2 at 0x941: file /home/yaxollum/yax/cpp/proj/hello.cpp, line 7.
[debug]>>>>>>cb_gdb:
[debug]> tty /dev/tty2
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: /home/yaxollum/yax/cpp/proj/bin/Debug/proj
[debug]Breakpoint 2, main () at /home/yaxollum/yax/cpp/proj/hello.cpp:8
[debug]/home/yaxollum/yax/cpp/proj/hello.cpp:8:68:beg:0x555555554941
[debug]>>>>>>cb_gdb:
[debug]> quit
Debugger finished with status 0