android crash 追踪方式

在调试android系统的c++库的时候,一种方案是我们使用gdb server方式,这种方式使用起来相对来说还是比较麻烦
现在有一个最简单方式,这种方式是针对有些个应用直接crash打印出一连串的错误
I/DEBUG   ( 1821):          #00  pc 67a79810 sp 6678ca60   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #01  pc 6758936c sp 6678ca88   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #02  pc 67570fec sp 6678cc28   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #03  pc 675744d0 sp 6678cc70   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #04  pc 675749e0 sp 6678cce8   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #05  pc 67574a34 sp 6678cd68   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #06  pc 67558418 sp 6678cd90   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #07  pc 6753e76c sp 6678cde8   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #08  pc 675bbd0c sp 6678ce40   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #09  pc 675bc988 sp 6678d108   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #10  pc 675bb618 sp 6678d160   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #11  pc 675bcb2c sp 6678d428   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #12  pc 6747fad4 sp 6678d478   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #13  pc 6776ca10 sp 6678d4c8   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #14  pc 677797a4 sp 6678d520   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #15  pc 677799b4 sp 6678d618   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #16  pc 67781204 sp 6678d650   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #17  pc 67781904 sp 6678d768   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #18  pc 67781a40 sp 6678d798   /system/lib/libwebcore.so
I/DEBUG   ( 1821):          #19  pc 767cddb4 sp 6678d7d0   /system/lib/libffi.so:ffi_call_O32+292
I/DEBUG   ( 1821):          #20  pc 767ce3bc sp 6678d7e8   /system/lib/libffi.so:ffi_call+128
I/DEBUG   ( 1821):          #21  pc 76894968 sp 6678d820   /system/lib/libdvm.so:dvmPlatformInvoke+384
I/DEBUG   ( 1821):          #22  pc 767cf354 sp 6678d890   /system/lib/libffi.so:ffi_type_sint32+0
I/DEBUG   ( 1821):          #23  pc 00000000 sp 6678d8c8
在一般的情况下我们想到的是,加些打印定位问题所在
细心的童鞋们可能会发现android在编译的时候,会同时生成symbol库,这个库直接就是debug库
我们直接把编译生成的带符号信息的debug放入系统中运行,你会发现如下信息
I/DEBUG   ( 1833):  s4 00000000  s5 66267f08  s6 000004be  s7 00000000
I/DEBUG   ( 1833):  t8 00000000  t9 675539c4  k0 67ee62a8  k1 00000000
I/DEBUG   ( 1833):  gp 67f62870  sp 66267a60  s8 00000001  ra 67062bf8
I/DEBUG   ( 1833):  hi 0000032f  lo 00006bbc bva 00000024 epc 675539fc
I/DEBUG   ( 1833):          #00  pc 675539fc sp 66267a60   /system/lib/libwebcore.so:_ZNK7WebCore7Element12getAttributeERKNS_13QualifiedNameE+56
I/DEBUG   ( 1833):          #01  pc 67062bf8 sp 66267a88   /system/lib/libwebcore.so:_ZN7WebCore20RenderBoxModelObject22paintFillLayerExtendedERKNS_9PaintInfoERKNS_5ColorEPKNS_9FillLayerEiiiiPNS_13InlineFlowBoxEiiNS_17CompositeOperatorEPNS_12RenderObjectE+3528
I/DEBUG   ( 1833):          #02  pc 6704a878 sp 66267c28   /system/lib/libwebcore.so:_ZN7WebCore9RenderBox14paintFillLayerERKNS_9PaintInfoERKNS_5ColorEPKNS_9FillLayerEiiiiNS_17CompositeOperatorEPNS_12RenderObjectE+92
I/DEBUG   ( 1833):          #03  pc 6704dd5c sp 66267c70   /system/lib/libwebcore.so:_ZN7WebCore9RenderBox22paintRootBoxFillLayersERKNS_9PaintInfoE+412
I/DEBUG   ( 1833):          #04  pc 6704e26c sp 66267ce8   /system/lib/libwebcore.so:_ZN7WebCore9RenderBox27paintBoxDecorationsWithSizeERNS_9PaintInfoEiiii+1008
I/DEBUG   ( 1833):          #05  pc 6704e2c0 sp 66267d68   /system/lib/libwebcore.so:_ZN7WebCore9RenderBox19paintBoxDecorationsERNS_9PaintInfoEii+76
I/DEBUG   ( 1833):          #06  pc 67031ca4 sp 66267d90   /system/lib/libwebcore.so:_ZN7WebCore11RenderBlock11paintObjectERNS_9PaintInfoEii+424
I/DEBUG   ( 1833):          #07  pc 67017ff8 sp 66267de8   /system/lib/libwebcore.so:_ZN7WebCore11RenderBlock5paintERNS_9PaintInfoEii+336
I/DEBUG   ( 1833):          #08  pc 67095598 sp 66267e40   /system/lib/libwebcore.so:_ZN7WebCore11RenderLayer10paintLayerEPS0_PNS_15GraphicsContextERKNS_7IntRectEjPNS_12RenderObjectEPN3WTF7HashMapIPNS_24OverlapTestRequestClientES4_NS9_7PtrHashISC_EENS9_10HashTraitsISC_EENSF_IS4_EEEEj+3612
I/DEBUG   ( 1833):          #09  pc 67096214 sp 66268108   /system/lib/libwebcore.so:_ZN7WebCore11RenderLayer9paintListEPN3WTF6VectorIPS0_Lj0EEES3_PNS_15GraphicsContextERKNS_7IntRectEjPNS_12RenderObjectEPNS1_7HashMapIPNS_24OverlapTestRequestClientES8_NS1_7PtrHashISF_EENS1_10HashTraitsISF_EENSI_IS8_EEEEj+144
I/DEBUG   ( 1833):          #10  pc 67094ea4 sp 66268160   /system/lib/libwebcore.so:_ZN7WebCore11RenderLayer10paintLayerEPS0_PNS_15GraphicsContextERKNS_7IntRectEjPNS_12RenderObjectEPN3WTF7HashMapIPNS_24OverlapTestRequestClientES4_NS9_7PtrHashISC_EENS9_10HashTraitsISC_EENSF_IS4_EEEEj+1832
I/DEBUG   ( 1833):          #11  pc 670963b8 sp 66268428   /system/lib/libwebcore.so:_ZN7WebCore11RenderLayer5paintEPNS_15GraphicsContextERKNS_7IntRectEjPNS_12RenderObjectE+104
I/DEBUG   ( 1833):          #12  pc 66f59360 sp 66268478   /system/lib/libwebcore.so:_ZN7WebCore9FrameView13paintContentsEPNS_15GraphicsContextERKNS_7IntRectE+460
I/DEBUG   ( 1833):          #13  pc 6724629c sp 662684c8   /system/lib/libwebcore.so:_ZN7android12WebFrameView4drawEPN7WebCore15GraphicsContextERKNS1_7IntRectE+476
I/DEBUG   ( 1833):          #14  pc 67253030 sp 66268520   /system/lib/libwebcore.so:_ZN7android11WebViewCore14rebuildPictureERK7SkIRect+472
I/DEBUG   ( 1833):          #15  pc 67253240 sp 66268618   /system/lib/libwebcore.so:_ZN7android11WebViewCore17rebuildPictureSetEPNS_10PictureSetE+176
I/DEBUG   ( 1833):          #16  pc 6725aa90 sp 66268650   /system/lib/libwebcore.so:_ZN7android11WebViewCore16recordPictureSetEPNS_10PictureSetE+1124
I/DEBUG   ( 1833):          #17  pc 6725b190 sp 66268768   /system/lib/libwebcore.so:_ZN7android11WebViewCore13recordContentEP8SkRegionP8SkIPoint+176
I/DEBUG   ( 1833):          #18  pc 6725b2cc sp 66268798   /system/lib/libwebcore.so:_ZN7androidL13RecordContentEP7_JNIEnvP8_jobjectS3_S3_+120
I/DEBUG   ( 1833):          #19  pc 762a9db4 sp 662687d0   /system/lib/libffi.so:ffi_call_O32+292
I/DEBUG   ( 1833):          #20  pc 762aa3bc sp 662687e8   /system/lib/libffi.so:ffi_call+128
I/DEBUG   ( 1833):          #21  pc 76370968 sp 66268820   /system/lib/libdvm.so:dvmPlatformInvoke+384
I/DEBUG   ( 1833):          #22  pc 762ab354 sp 66268890   /system/lib/libffi.so:ffi_type_sint32+0
出错的函数直接给打印出来了,是不是很方便阿








你可能感兴趣的:(c,android,server,360,Crash)