关闭

打印tombstone堆栈脚本

549人阅读 评论(0) 收藏 举报
快速打印tombstone中堆栈对应函数和源码位置的命令:
将生成的堆栈信息,如
         #00  pc 000110d8  /system/lib/libc.so
         #01  pc 00050b44  /system/lib/libopencore_common.so
         #02  pc 0005094e  /system/lib/libopencore_common.so
         #03  pc 000efc58  /system/lib/libopencore_player.so
         #04  pc 000ebe44  /system/lib/libopencore_player.so
         #05  pc 000ec0b6  /system/lib/libopencore_player.so
         #06  pc 000161dc  /system/lib/libmediaplayerservice.so
         #07  pc 000162b2  /system/lib/libmediaplayerservice.so
         #08  pc 00016962  /system/lib/libmediaplayerservice.so
         #09  pc 00017a32  /system/lib/libmediaplayerservice.so
         #10  pc 000375dc  /system/lib/libmedia.so
 
注意不要包含其它内容,保存到linux android编译环境根目录下的某个文件如stack.txt,设置好编译环境后(不然会找不到arm-eabi-addr2line),运行:
awk '{for (i = 0; i <NF; ++i){if (i%4==3) system("arm-eabi-addr2line -f -e out/target/product/ua8200/symbols"$(i+1)" "$i)}}' < stack.txt
 
注意其中的product name ua8200根据实际情况修改,本例中得到结果如下:
pthread_key_delete
/home/sw/xgm/msm7x30/gingerbread/bionic/libc/bionic/pthread.c:1705
_ZN15OsclTLSRegistry7cleanupER13Oscl_DefAllocRi
/home/sw/xgm/msm7x30/gingerbread/external/opencore/oscl/oscl/osclbase/src/oscl_tls.cpp:181
_ZN8OsclBase7CleanupEv
/home/sw/xgm/msm7x30/gingerbread/external/opencore/oscl/oscl/osclbase/src/oscl_base.cpp:67
_Z21UninitializeForThreadv
/home/sw/xgm/msm7x30/gingerbread/external/opencore/android/thread_init.cpp:106
_ZN7android13doUsePVPlayerEPKc
/home/sw/xgm/msm7x30/gingerbread/external/opencore/android/playerdriver.cpp:2248
_ZN7android8PVPlayer11usePVPlayerEPKc
/home/sw/xgm/msm7x30/gingerbread/external/opencore/android/playerdriver.cpp:2383
_ZN7androidL20getDefaultPlayerTypeEPKc
/home/sw/xgm/msm7x30/gingerbread/frameworks/base/media/libmediaplayerservice/MediaPlayerService.cpp:686
_ZN7android13getPlayerTypeEPKc
/home/sw/xgm/msm7x30/gingerbread/frameworks/base/media/libmediaplayerservice/MediaPlayerService.cpp:791
_ZN7android18MediaPlayerService6Client13setDataSourceEPKcPKNS_11KeyedVectorINS_7String8ES5_EE
/home/sw/xgm/msm7x30/gingerbread/frameworks/base/media/libmediaplayerservice/MediaPlayerService.cpp:867
_ZN7android18MediaPlayerService6createEiRKNS_2spINS_18IMediaPlayerClientEEEPKcPKNS_11KeyedVectorINS_7String8ES9_EEi
/home/sw/xgm/msm7x30/gingerbread/frameworks/base/media/libmediaplayerservice/MediaPlayerService.cpp:263
_ZN7android20BnMediaPlayerService10onTransactEjRKNS_6ParcelEPS1_j
/home/sw/xgm/msm7x30/gingerbread/frameworks/base/media/libmedia/IMediaPlayerService.cpp:169
 
输出格式为
函数名
源文件:行数

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:22984次
    • 积分:389
    • 等级:
    • 排名:千里之外
    • 原创:15篇
    • 转载:5篇
    • 译文:0篇
    • 评论:1条
    最新评论