#10
gcc -DTEST #define TEST, if source code include "ifdef TEST" there are a lot of ...
cpp -dM /dev/null
gcc -DName=Value test.c #Name is not need to be defined in source code.
gcc -E test.c #No compile,just see the predefine process result
#11
gcc -g test.c #option for debugging, recommended for development and deployment
ulimit -c unlimited #for creating core-dump file
gdb a.out core-file #gdb need two file(source+dump)
#12
#Function call overhead (额外开销)
#13
gcc -O0 test.c #no optimization, 03 is highest level.
time ./a.out #output the executed time
gcc -O2 test.c #Data-flow analysis, for instance,no initialized variable will be warning
#14
gcc
g++
#15
cpp test.c > test.i #C PreProcess
gcc -S test.i # to assembly language named test.s
as test.s -o test.o
file a.out #inform for a file
nm #symbol table
ldd #load dynamic libarary
#16
gcc -Wall -pg test.c #gprof
gprof a.out #gmon.out
gcc -Wall -fprofile-arcs -ftest-coverage test.c #gcov
grep "#####" test.gconv #display the uncovered lines
阅读(313) | 评论(0) | 转发(0) |