Usually people uses gdb to debug when obtain core dump file. A very common error that trigger core dump is segmentation fault happen, check out this example to get more idea regarding core dump, and gdb. Additional link, here is a great tutorial shows you how to debug when occur segmentation fault.
This post is to show you some tips while using gdb. To run gdb with on an errornous program, do this:
1. To run shell command in gdb, let say I wanna make clean and make again.
shell make clean;make
2. Auto complete feature by hitting <Tab>, let say I wanna break at a function in class Client, I can see the alternatives symbols like this
[b is also known as break]
3. To get help in gdb. Gdb have plenty of command, usually people uses help to search for the command info.
Alternatively what if you do not know the command name, you can search for keyword using apropos.
This will return
reverse-search -- Search backward for regular expression (see regex(3)) from last line listed tfind -- Select a trace frame;
You can also list all the commands available by giving initial
backtrace break bt
4. Threads, If your program have multiple threads, you can check out them like this
And you can get into the thread by
to go to thread #2.
If you are seriously wanna use gdb, remember to read this, It is a very complete documentation regarding gdb.
Okay, I have to get back to my debugging @.@