Saturday

gdb command to check the default ISO standard C++ year

Do the following steps.

Open command prompt window.
Compile program with -g flag to generate debug info
> g++ example.cpp -g

Debug program with gdb
> gdb a.exe

Put a breakpoint at main() function
(gdb) b main

Run program which will pause at breakpoint
(gdb) run

gdb information source
(gdb) info source
Output something like the following:
{
Current source file is example.cpp
Compilation directory is C:\Users\xxx\Desktop\cpp_directory
Located in C:\Users\xxx\Desktop\cpp_directory\example.cpp
Contains 21 lines.
Source language is c++.
Producer is GNU C++14 8.1.0 -mtune=core2 -march=nocona -g.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.
}

(gdb) quit
>

No comments:

Fire survival tips

1 Stop, drop, cover and roll  If your clothes catch fire stop, drop, cover your face with your hands and roll to smother the flames. 2 Get d...