gdb is quite a useful tool. Despite it’s text interface, it can do more than GUI debuggers. I am still learning it, and this post is used as a memo.
- ptype is useful to print type, structure(class) definition. This is useful to check user defined data types(sometimes deeply defined in header files).
- disassemble is useful to see assembly code of function/statement.
- info registers shows registers information.
- print a@10 shows 10 elements start from address of variable a.
- _x_ command examine memory content. x/8xw $eip displays 8 words since where eip register points to. x/i $eip
shows instruction eip register points to.