Friday, April 24, 2009

World Reading Day

Below is a list of good software books:
Top 100 Best Software Engineering Books, Ever

Personally, I am a little surprised that Eric Evans' "Domain-Driven Design" ranks so low. And "Object Design: Roles Responsibilities and Collaborations" by Rebecca Wirfs-Brock is not on the list which is also worth reading:)

As someone commented, the list is more likely to be based on the popularity (good or not is really a subjective judgment which lacks the objective criteria:), but still, a good reference for reading.

(BTW: The original creator of the list has published another list of Top 50 New Software Development Books which may still need time proven:)

Saturday, April 4, 2009

Tips for debugging mediaserver

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