Locating source in gdb
when do a "bt", some times you get result like below:
+ 2665 ic_imsql__getResourceIterator (in mediaserver) + 1187 [0x211333]..
see where it says +1187 ?
you can do
gdb ./mediaserver
then
list *ic_imsql__getResourceIterator + 1187
Attaching a running resource to gdb
use "ps" to find out the pid of the running process, the do
gdb ./mediaserver pid_of_process
Now we can do the various gdb to debug that running process
Back track all the threads
thread apply all bt
Checking memory heap usage and leak
http://valgrind.org/docs/manual/mc-manual.html#mc-manual.leaks
http://valgrind.org/docs/manual/ms-manual.html
An example:
valgrind --tool=memcheck --leak-check=full -v ./test_app1 2
No comments:
Post a Comment