android - Android 上共享库的偏移量

标签 android crash shared-libraries offset

在我的项目崩溃后,我得到了这样的日志

I/DEBUG   ( 1133):  r0 0000deed  r1 00001234  r2 deedbeed  r3 00000000
I/DEBUG   ( 1133):  r4 befab4c0  r5 00000007  r6 befab548  r7 4214cb20
I/DEBUG   ( 1133):  r8 befab49c  r9 4214cb0c  10 4214caf8  fp 81da5368
I/DEBUG   ( 1133):  ip 80003108  sp befab440  lr 845133d4  pc 844ed8f0  cpsr 60000010
I/DEBUG   ( 1133):  d0  7165722068736175  d1  4320585858585865
I/DEBUG   ( 1133):  d2  006f006900740073  d3  00200030003d0074
I/DEBUG   ( 1133):  d4  4214e9804214e94c  d5  4214e9e84214e9b4
I/DEBUG   ( 1133):  d6  3ce2000000000000  d7  000000424214ea84
I/DEBUG   ( 1133):  d8  0000000000000000  d9  0000000000000000
I/DEBUG   ( 1133):  d10 0000000000000000  d11 0000000000000000
I/DEBUG   ( 1133):  d12 0000000000000000  d13 0000000000000000
I/DEBUG   ( 1133):  d14 0000000000000000  d15 0000000000000000
I/DEBUG   ( 1133):  d16 4050800000000000  d17 4050800000000000
I/DEBUG   ( 1133):  d18 4018000000000000  d19 3fe00000000000b4
I/DEBUG   ( 1133):  d20 3ff0000000000000  d21 8000000000000000
I/DEBUG   ( 1133):  d22 0000000000000000  d23 ff00000000000000
I/DEBUG   ( 1133):  d24 ff00000000000000  d25 ff00000000000000
I/DEBUG   ( 1133):  d26 0100010001000100  d27 0100010001000100
I/DEBUG   ( 1133):  d28 0100010001000100  d29 3ff0000000000000
I/DEBUG   ( 1133):  d30 0000000000000000  d31 3ff0000000000000
I/DEBUG   ( 1133):  scr 20000012
I/DEBUG   ( 1133): 
I/DEBUG   ( 1133):          #00  pc 000ed8f0  libmyproject.so
I/DEBUG   ( 1133):          #01  lr 845133d4  libmyproject.so
I/DEBUG   ( 1133): 
I/DEBUG   ( 1133): code around pc:
I/DEBUG   ( 1133): 844ed8d0 e52de004 e24dd014 e58d0004 e58d1000 
I/DEBUG   ( 1133): 844ed8e0 e28d301c e58d300c e59d3004 e5933000 
I/DEBUG   ( 1133): 844ed8f0 e593c238 e59d0004 e59d1000 e59d2018 
I/DEBUG   ( 1133): 844ed900 e59d300c e12fff3c e28dd014 e49de004 
I/DEBUG   ( 1133): 844ed910 e28dd008 e12fff1e e52de004 e24dd00c 
I/DEBUG   ( 1133): 
I/DEBUG   ( 1133): code around lr:
I/DEBUG   ( 1133): 845133b4 e2433013 e58d3024 e59d0024 e3a01c12 
I/DEBUG   ( 1133): 845133c4 e2811034 e59f212c e3a03000 ebff693d 
I/DEBUG   ( 1133): 845133d4 ebff5e4c e1a03000 e3530000 0a000008 
I/DEBUG   ( 1133): 845133e4 ebff5e48 e1a03000 e1a00003 ebfffa85 
I/DEBUG   ( 1133): 845133f4 e1a03000 e3530000 0a000001 e3a03001 
I/DEBUG   ( 1133): 
I/DEBUG   ( 1133): stack:
I/DEBUG   ( 1133):     befab400  00770518  
I/DEBUG   ( 1133):     befab404  0000a000  
I/DEBUG   ( 1133):     befab408  befab4a0  
I/DEBUG   ( 1133):     befab40c  4214cafc  
I/DEBUG   ( 1133):     befab410  0000abe0  
I/DEBUG   ( 1133):     befab414  afd13663  /system/lib/libc.so
I/DEBUG   ( 1133):     befab418  0000ce60  
I/DEBUG   ( 1133):     befab41c  00770518  
I/DEBUG   ( 1133):     befab420  befab548  
I/DEBUG   ( 1133):     befab424  4214cb04  
I/DEBUG   ( 1133):     befab428  0000ce60  
I/DEBUG   ( 1133):     befab42c  00770518  
I/DEBUG   ( 1133):     befab430  befab548  
I/DEBUG   ( 1133):     befab434  81d48eb9  /system/lib/libdvm.so
I/DEBUG   ( 1133):     befab438  e3a07077  
I/DEBUG   ( 1133):     befab43c  ef900077  
I/DEBUG   ( 1133): #00 befab440  00001234  
I/DEBUG   ( 1133):     befab444  0000deed  
I/DEBUG   ( 1133):     befab448  00000007  
I/DEBUG   ( 1133):     befab44c  befab45c  
I/DEBUG   ( 1133):     befab450  4214cb20  
I/DEBUG   ( 1133):     befab454  845133d4  libmyproject.so
I/DEBUG   ( 1133):     befab458  deedbeed  
I/DEBUG   ( 1133):     befab45c  00000000  
I/DEBUG   ( 1133):     befab460  000009f4  
I/DEBUG   ( 1133):     befab464  4462e744  
I/DEBUG   ( 1133):     befab468  000001c7  
I/DEBUG   ( 1133):     befab46c  00000000  
I/DEBUG   ( 1133):     befab470  40532730  
I/DEBUG   ( 1133):     befab474  0000abe0  
I/DEBUG   ( 1133):     befab478  befab4c8  
I/DEBUG   ( 1133):     befab47c  81d68e49 
I/DEBUG   ( 1133):     befab480  40532730  
I/DEBUG   ( 1133):     befab484  0000deed  

但是我的 map 文件没有像 0x845133d4 这样的值。我想我需要知道偏移量的值。我在哪里可以找到它?

编辑

我找到了线索(http://groups.google.com/group/android-ndk/browse_thread/thread/83012b9a9633a6d6)如何找到这个偏移量,但是我的/proc/maps是空的

编辑2

在具有 root 权限的设备上 adb shell cat /proc/<pid>/maps给我:

...
82000000-83665000 r-xp 00000000 b3:02 5603348    libmyproject.so
83665000-836c6000 rwxp 01664000 b3:02 5603348    libmyproject.so
...

有人能确认这只能在 root 设备上吗?有人知道如何在没有root的情况下做到这一点吗?

最佳答案

每个应用程序都可以访问文件/proc/self/maps,此文件中包含我正在寻找的信息:)

关于android - Android 上共享库的偏移量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5089829/

相关文章:

mysql - 自动监控 MySQL 服务器的崩溃表

c - 在公共(public)头文件中包含条件是否被认为是好的做法?

android - 为什么 RxJava 经常与 Retrofit 一起使用?

android - 是否可以在模拟器上使用已发布的即时应用程序(BuzzFeed、Wish 等)?

android - 从 Activity 中设置 fragment 的参数

java - 为什么在 android ArrayAdapter 中找不到我的 textView?

android - 为什么汽车底座会搞乱我的应用程序?

python - IDLE 3.4.3 运行模块时崩溃

linux - 共享库的 Makefile?

c++ - FreeLibrary() 在 Linux 上工作吗?