2017-08-02
Cscope Usage

Actually the source insight is the fist choice code viewing tool for me, but it requires license and in Linux the vim is the powerful editor for me. So to better understanding the code, cscope is the best choice for me to read code in vim. Now i used the cscope more and more often.

Generate the cscope meta data

Enter below commands at the top dir of the project, and then cscope.out will be generated:

find . -name “*.h” -o -name “*.c” -o -name “*.cc” -o -name “*.cpp” > cscope.files
cscope -bqR -i cscope.files

More parameters you can refer to cscope -h.

Read More

2017-07-31
Advanced GDB Usage

This Page was a summary of the advanced gdb usge in daily work, for the basic usage of gdb will not being described here.

1. Advanced commands in using

gdb> info share - show the shared libraries load by process.
gdb> until (line number) - run until to the line number in case you want to break out the while&for loop.
gdb> finish - run out of the this function call.
gdb> call (function name) - call a function in current context.
gdb> disas (function name) - check the assembly code for a function.
gdb> run (arguments) - run the program with arguments.
gdb> bt - get the call stack for current thread.
gdb> frame (stack number) - change stack frame to specfic function call.
gdb> info regs - show the values of current registers.
gdb> list filename:line - list the code of filename:line
gdb> info - list all info sub commands and which are helpful.

Read More