Recommended option: gcc -ansi -pedantic -Wall -Wextra -Wconversion -Wshadow -Wcast-qual -Wwrite-strings
To core dump: ulimit -c unlimited
GDB command: gdb a.out core
Optimization level: -O0 to -O3
Verbose debugging: gcc -v
Prevent excessive memory usage: ulimit -v limit
Prevent excessive memory usage soft limit : ulimit -S -v limit
GNU archiver to create: ar cr
GNU archiver to list .o: ar t
Profiler gprof: gcc -pg file.c, gprof a.out
Code coverage gcov: gcc -fprofile-arcs -ftest-coverage cov.c, gcov cov.c
Tool-chain:
Preprocessing: cpp
gcc --save-temps
To assembly: gcc -S
Assembly to machine: as file.s -o file.o
Linker: ld -dynamic-linker
To find details of a.out: file a.out
Examining symbol table: nm a.out
Find dynamically linked libraries: ldd a.out
No comments:
Post a Comment