2011年12月1日 星期四

GNU Debugger (GDB)

CROSS is the prefix of your cross-compiler, e.g. for mips64-linux-gnu-gcc, CROSS=mips64-linux-gnu
(Add the path to your cross-compiler to $PATH)

CROSS=mips64-octeon-linux-gnu

wget http://ftp.gnu.org/gnu/gdb/gdb-7.6.1.tar.bz2


tar xf gdb-7.6.1.tar.bz2
cd gdb-7.6.1/
mkdir build-mips
cd build-mips/


../configure --target=$(CROSS} --prefix=$(pwd)/install
make
make install



GDB: The GNU Project Debugger
http://www.gnu.org/s/gdb/

基本gdb
http://www.study-area.org/cyril/opentools/opentools/x1253.html

Debugging with GDB (入門篇)
http://www.study-area.org/goldencat/debug.htm

使用GDB來進行除錯
http://www.cis.nctu.edu.tw/~is93007/acd.htm

GDB Cheat Sheet - GDB Cheat Sheet.pdf
http://darkdust.net/files/GDB%20Cheat%20Sheet.pdf

tools - How to handle stripped binaries with GDB? No source, no symbols and GDB only shows addresses? - Reverse Engineering Stack Exchange
http://reverseengineering.stackexchange.com/questions/1935/how-to-handle-stripped-binaries-with-gdb-no-source-no-symbols-and-gdb-only-sho?rq=1

gdb backtrace to file • Andreas Schneider
http://blog.cryptomilk.org/2010/12/23/gdb-backtrace-to-file/
# alias bt='echo 0 | gdb -batch-silent -ex "run" -ex "set logging overwrite on" -ex "set logging file gdb.bt" -ex "set logging on" -ex "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo backtrace:\n" -ex "backtrace full" -ex "echo \n\nregisters:\n" -ex "info registers" -ex "echo \n\ncurrent instructions:\n" -ex "x/16i \$pc" -ex "echo \n\nthreads backtrace:\n" -ex "thread apply all backtrace" -ex "set logging off" -ex "quit" --args'

# bt $crashing_application
fcamel 技術隨手記: 用 python gdb 客製化 backtrace 的結果
http://fcamel-life.blogspot.tw/2013/08/python-gdb-backtrace.html



GDB complaint "Error opening terminal: xterm." while using "-tui" or GDB command "layout"
export TERMINFO=/lib/terminfo
Question #207761 : Questions : GCC ARM Embedded
https://answers.launchpad.net/gcc-arm-embedded/+question/207761




沒有留言: