Android Debugging
Follow me on twitter @ihackbanme
If you read this, most likely you’ve tried to debug something on Android and found out it’s not as easy as you would have wanted it to be.
Here’s a short tutorial, from my memory to get it working. If I forgot something, please write it down in the comments and I will keep this post updated.
First, There are many mistakes that can be made. The documentation/instructions and warnings under Google’s Android website are less useful and you can find yourself compiling the whole environment of Android 2.1 on Ubuntu 8.04 (which is a very big mistake, and you’ll waste your time – so don’t do it!).
Make sure you use latest Ubuntu (I’m not a big fan of Ubuntu, as a Slackware user for the last 10 years, but apt-get just does a good job in this setup) to build latest Android.
Download Android using GIT & REPO:

repo init -u git://android.git.kernel.org/platform/manifest.git -b 
e.g :
repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair
This should take a few hours… ;)
Compile Webkit with debugging flags, I’m quite sure this link was helpful, but I also quite sure there were few mistakes which I don’t remember, I do remember it wasn’t perfect buildspec.mk so just change it to fit your debugging needs.
The link had the following instructions: 
Debug Native C++ Code:
To get meaningful debug info, you do need to build WebCore with -

O0. It is simple. Add the following to your buildspec.mk and rebuild webcore and xml2.