1.
进入源码目录
cd /mnt/usb/sda1/tv_mainpage-0.9.30/build
2.
执行命令
gdb -args ./tv_mainpage -qws -display directfb
3.查看对应的出错地址的代码list
(gdb) l *(0x407c6c)
0x407c6c is in _GLOBAL__sub_I__ZN8SysProxy10m_instanceE() (../../../host/usr/mipsel-buildroot-linux-gnu/sysroot/usr/include/QtCore/qobject.h:113).
108 ../../../host/usr/mipsel-buildroot-linux-gnu/sysroot/usr/include/QtCore/qobject.h: No such file or directory.
list *(0x400850)
4.dump出二进制文件
查看地址
服务器上执行
mips-linux-gnu-objdump -d ./tv_mainpage >tv_mainpage.dump
5.vi tv_mainpage.dump
或者查找
grep -n -A 10 -B 10 "407c58" ./tv_mainpage.dump
定位地址然后往上找到头地址,查看对应的代码
176 00407c58 <_GLOBAL__sub_I__ZN8SysProxy10m_instanceE>:
177 407c58: 27bdffd8 addiu sp,sp,-40
178 407c5c: 3c020045 lui v0,0x45
179 407c60: 3c060043 lui a2,0x43
180 407c64: afb1001c sw s1,28(sp)
181 407c68: afb00018 sw s0,24(sp)
182 407c6c: 3c110045 lui s1,0x45
(gdb) l *(0x00407c58)
0x407c58 is in _GLOBAL__sub_I__ZN8SysProxy10m_instanceE() (../src/sysProxy.cpp:283).
278
279 int SysProxy::getVolume()
280 {
281 int vol = SystemServiceGetVolume();
282 return vol;
283 }
6.命令行获取堆栈相关信息
打印pid进程所有线程的堆栈并退出。
gdb -ex "set pagination 0" -ex "thread apply all bt" -batch -p pid
kill -s SIGSEGV pid