1. Add symbol file for dynamically loaded so, e.g. libopencore_asflocal.so
(1) Find where the module was loaded:
#cat /proc/<pid>/maps
a7c26000-a7c52000 r-xp 00000000 1f:06 1060 /system/lib/libopencore_asfloca
l.so
a7c52000-a7c54000 rw-p 0002c000 1f:06 1060 /system/lib/libopencore_asfloca
l.so
(2) Get the text section's offset within the module:
$objdump --section-headers out/target/product/generic/symbols/system/lib/libopencore_asflocal.so |grep text
6 .text 0001679c 0000e3c8 0000e3c8 0000e3c8 2**3
(3) Add this offset to the load address of the module to obtain the relocation address for the module's code: (0xa7c26000+0x0000e3c8 = 0xa7c343c8)
(gdb)add-symbol-file out/target/product/generic/symbols/system/lib/libopencore_asflocal.so 0xa7c343c8
2. Switch between threads inside mediaserver process
(gdb) info threads
(gdb) thread <id>
[1]Debugging with GDB
[2]Debugging Loadable Modules Using GDB
[3]Debugging programs with multiple threads
No comments:
Post a Comment