2012/03/14

Debugging Tricks

Locating source  in gdb
when do a "bt", some times you get result like below:
+ 2665 ic_imsql__getResourceIterator  (in mediaserver) + 1187  [0x211333]..
see where it says +1187 ?

you can do
gdb ./mediaserver

then
list *ic_imsql__getResourceIterator + 1187


Attaching a running resource to gdb
use "ps" to find out the pid of the running process,  the do
gdb ./mediaserver pid_of_process

Now we can do the various gdb to debug that running process


Back track all the threads
thread apply all bt 


Checking memory heap usage and leak
http://valgrind.org/docs/manual/mc-manual.html#mc-manual.leaks
http://valgrind.org/docs/manual/ms-manual.html
An example:
valgrind --tool=memcheck --leak-check=full -v  ./test_app1 2

2012/03/10

iOS View Transition

An example, from Apple WorldCities sample code: 

[self.navigationController presentModalViewController:self.worldCitiesListNavigationController animated:YES];

Post Code on Blogger

Simplest way to post code to blogger for me: <pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black;overflow-x:...