gdb+gdbserver

来源:互联网 发布:全民枪战抽奖软件 编辑:程序博客网 时间:2024/05/20 23:40

gdb移植:

export PATH=/home/zhaiyy/toolchain/mipsel-34kv3r1-20121018/bin:$PATH

export TARGET="mipsel-34kv3r1-linux-gnu"
export HOST="mipsel-34kv3r1-linux-gnu"

export CC="${HOST}-gcc"
export CXX="${HOST}-g++"
export AR="${HOST}-ar"
export AS="${HOST}-as"
export RANLIB="${HOST}-ranlib"
export LD="${HOST}-ld"
export STRIP="${HOST}-strip"

./configure --host=$HOST --target=$TARGET --without-ada --enable-termcap --with-shared --prefix=/home/zhaiyy/ncurses
make &make install

/home/zhaiyy/gdb-7.3/configure --host=$HOST --target=$TARGET --enable-shared --disable-gdbtk --disable-tui --without-included-regex --without-included-gettext --prefix=/home/zhaiyy/gdb
make &make install

gdb+gdbserver:

network_init.sh
ifconfig eth0 down
ifconfig eth0 hw ether 22:54:76:19:BA:CC
ifconfig eth0 109.123.122.109
ifconfig eth0 109.123.122.109 up
ping 109.123.122.225
usb_start.sh
cd dtv/usb/sda1/
./gdbserver --debug --remote-debug 109.123.122.109:2345 test
./gdbserver --debug --remote-debug 109.123.122.109:2345 --attach 129
set solib-search-path /home/zhaiyy/toolchain/arm-v7a15v3r1-20121018/arm-v7a15v3r1-linux-gnueabi/sys-root/lib/
set remotetimeout 60
target remote 109.123.122.109:2345

(gdb) set solib-absolute-prefix /androidsrc/out/target/product/generic/symbols/
(gdb) set solib-search-path /androidsrc/out/target/product/generic/symbols/system/lib/

solib-absolute-prefix :设置查找共享库的前缀,作为查找so库路径的前缀;
solib-search-path :设置so库的查找路径,它是在根据solib-absolute-prefix 查找库失败后使用