gdb调试运行程序带参数(调用动态链接库),debug过程记录


library多线程file1.gdb (运行程序名称)

例如

gdb cbenchmark

 

2.设置运行参数

set args -c 1 -n 1 -F ./libaliww.so -l 1

 

3.如果是多线程程序

set follow-fork-mode child

 

4.设置断点,如果代码是动态链接库.so中的代码系统会提示如提示1

b CWWSimulator.cpp:530

 

提示1:

No source file named CWWSimulator.cpp.
Make breakpoint pending on future shared library load? (y or [n])

输入y,回车

 

经过如上步骤即可断到相关代码

posted on 2014-04-20 14:23  bitbit  阅读(2850)  评论(0编辑  收藏  举报