Gcc -g Option Flag (debug)
gcc -g generates debug information to be used by GDB debugger.
| option | description |
|---|---|
| -g0 | no debug information |
| -g1 | minimal debug information |
| -g | default debug information |
| -g3 | maximal debug information |
Syntax
$ gcc -glevel [options] [source files] [object files] [-o output file]
Example
Write source file myfile.c:
// myfile.c #include <stdio.h> void main() { printf("Program run!!\n"); }
Build myfile.c on terminal and run gdb to debug:
$ gcc -g myfile.c -o myfile $ gdb myfile (gdb) run Starting program: /home/ubuntu/myfile Program run!! Program exited with code 012. (gdb) quit $
See also
- gcc
- gcc -c
- gcc -D
- gcc -I
- gcc -L -l
- gcc -o
- gcc -O
- gcc -Wall
Write how to improve this page
Submit FeedbackGCC
- gcc -c
- gcc -D
- gcc -fPIC
- gcc -g
- gcc -I
- gcc -L -l
- gcc -o
- gcc -O
- gcc -Wall
RAPID TABLES
- Recommend Site
- Send Feedback
- About
© RapidTables.com | About | Terms of Use | Privacy Policy | Cookie Settings
Từ khóa » G Gcc
-
Gcc -g :what Will Happen - C++ - Stack Overflow
-
GCC, The GNU Compiler Collection - GNU Project
-
Hướng Dẫn Cài đặt Trình Biên Dịch C/C++ MinGW (gcc) - CodeCute
-
Difference Between GCC And G++ - Byjus
-
Sự Khác Biệt Giữa GCC Và G ++ - Cổng Thông Tin Đại Học, Cao ...
-
Get Started With C++ And Mingw-w64 In Visual Studio Code
-
How Do I Use Gcc, G++, And Gdb? - CETS
-
Gulf Cooperation Council (GCC) – Toy G-mark Certification - SGS
-
- G++, Gcc
-
G++ Cheatsheet - USC Bytes
-
Sự Khác Biệt Giữa G ++ Và Gcc Là Gì? - HelpEx
-
Cờ GCC -g Vs -g3 GDB: Sự Khác Biệt Là Gì? - HelpEx
-
Gcc Là Gì - C++ — Sự Khác Biệt Giữa G ++ Và
-
Xilinx SDK Dual/Mixed G++ & Gcc Compiler Toolchain