1.主机上编译目标程序
damon@cimov-damon:~$ mipsel-linux-gdb myprogram
.........
设置动态库的路径
(gdb)>set solib-absolute-prefix /nfsroot/rootfs
(dbg)>set solib-search-path /nfsroot/rootfs/lib
(gdb)>target remote 192.168.1.159:1234 (主机运行)
(板子ip) (端口号)
启动程序
(gdb)>c
查看堆栈信息
(gdb)>bt
root# gdbserver 192.168.1.157:1234 myprogram (板子运行)
(主机ip) (端口号)
Listening on port 1234
Remote debugging from host 192.168.1.157