Android Debugging on MIPS Platform with Viosoft Arriba Debugger
I’ve recently attended a webinar organized by EETIMES with MIPS and Viosoft entitled “Android Platform: It’s Not Just For Handsets Anymore” on the 26th October 2010. You can now register for the on demand version at http://seminar2.techonline.com/s/mips_oct0610
The purpose of this web conference was to explain the status of Android for Set-top-box and MID development, the complexity of debugging kernel, java and application in an Android system as well as showcasing Viosoft Arriba to debug Android on MIPS. If you ever develop Android on Sigma Designs SMP864x/SMP865x platforms you’ll probably use Viosoft Arriba.
You may refer to the following material Comprehensive Development and Debug Coverage for Linux and Android on the MIPS Architecture that contains the slides used during the presentation.
Rick Leatherman – Vice President, Development Tools at MIPS Technologies, Inc – firstly described Android architecture with the application level, Library/Android (Dalvik), and the kernel.
He then explained the status of Android for different devices:
- Mobile: 99% complete, if hardware and Linux is the exactly the same, otherwise about 80% completed, since you would need to integrate Android into your own kernel.
- MID (Mobile Internet Devices): 70% complete. Most of the work to be done is for the screen size, input device support…
- Set-top box: 50% complete. A lot of the work has to do with remote control support (As it changes the way the user interacts with Android considerably) and different screen sizes.
- Embedded Systems: Unknown. It depends on the system, but most likely a lot of work has to be done at all levels of Android.
The main point here was that you may consider only doing Java debugging for handsets, but this won’t be sufficient for other platforms where you’ll have to dig into the kernel and JAVA VM. Furthermore, with Android, the user space and kernel space is not separated as in a pure Linux platform with applications in user space and drivers in Kernel space, so specific tools must be used to debug thru the different layers of the system: application (Java,C/C++, Action Script Programming), Dalvik and kernel (C programming).
From a developer point of view, the differences between a traditional Linux platform and Android are show below:
|Traditional Linux Platforms||Android|
|Single/few processes||Multiple processes, with program logic straddling process barriers|
|Applications mostly execute in User Space||Applications partitioned between User Space and Kernel Space|
|One process per application||Multiple processes per application|
This explains why Android is so difficult to debug, since software engineers are required to know more programming languages, Android applications cross process barrier (Client/Server,JNI, CORBA/IDL…) and they runs both in user & kernel spaces.
Rick carries on explaining the traditional tools to debug the application (gdbserver) and kernel (kgdb) have too many limitations to properly debug Android platform, since you cannot debug the middleware and explains how Arriba Embedded Linux/Android can handle debugging better as it can work with all layers.
The next part of the webinar showcases Arriba Debugger for the following cases:
- Kernel and Driver
- Dalvik Application
- Dalvik VM
Hieu T. Tran – CEO-Founder, Viosoft Corporation – first demo’ed the kernel and driver debugging.
He ran the Arriba debugger based on Eclipse platform in Ubuntu connected to the target through Ethernet (JTAG and USB are also available). He explained Viosoft Arriba will not stop the full system (Run mode) if a breakpoint is hit, unless Stop mode is selected.
He inserted a breakpoint in fs/namei.c part of the Linux file system to demonstrate the debug platform. You’ll be able to see C and assembly code, have access to gdb command line, see which process are running…
He then debugged a Dalvik application (ANDMediaPlayer) and showed the 2 connection one to the C domain (Kernel) and one to the Java domain (Application), as you can see in the screenshot below.
Finally, he showed the case debugging Dalvik Virtual Machine.
In the final part of the presentation, Rick talked about Arriba Linux/Android Event Analyzer that allows software engineers to profile their application and see different types of events per process (up to 20 seconds capture).
The source code for Android MIPS is available at http://www.mips.com/android
Live Android Debug demo can also be scheduled, you may contact MIPS if you wish to do so.