Debugging native library crashes

753 views
Skip to first unread message

Yoav Weiss

unread,
Jan 7, 2009, 3:31:16 AM1/7/09
to android-...@googlegroups.com
Hi,

I'll take the risk of asking a stupid question, but is there an easy way to debug crashes in native libraries?
I made some modifications to one of the libraries and encountered a crash, but I couldn't figure out the crash code stack from the logs. All I see there is PC addresses, but I don't know how to correlate them with the actual code.
Is there a way to get a core dump and gdb it?

Thanks in advance,
Yoav

fadden

unread,
Jan 7, 2009, 8:26:40 PM1/7/09
to android-platform
You can try:

# setprop debug.db.uid 32767

That will cause the crash catcher (debuggerd) to freeze the process,
allowing you to use gdb/gdbserver to debug it.

In the source tree, after you "source build/envsetup.sh" and use
"lunch" or "choosecombo", you will have a shell command called
"gdbclient". By default, it expects to debug "app_process" on port
5039 using the symbol-endowed shared libraries found in the "out"
directory (you may need "adb forward tcp:5039 tcp:5039" to set up the
TCP bridge). If you want to debug something else, you can issue the
gdb/gdbserver commands manually.

A prebuilt ARM "gdbserver" is included in the cupcake source tree.

Robert K. Barrett

unread,
Jan 7, 2009, 8:49:10 PM1/7/09
to android-...@googlegroups.com
Get dee bug spray
2 Corinthians 13:14

The grace of the Lord Jesus Christ, and the love of God, and
the communion of the Holy Spirit be with you all. Amen.

Smile, someone loves you.

Reply all
Reply to author
Forward
0 new messages