[Pidgin] GSoC2012/Android/debugging modified

Pidgin trac at pidgin.im
Thu Jun 7 08:46:54 EDT 2012

Changed page "GSoC2012/Android/debugging" by michaelz from*
Page URL: <http://developer.pidgin.im/wiki/GSoC2012/Android/debugging>
Diff URL: <http://developer.pidgin.im/wiki/GSoC2012/Android/debugging?action=diff&version=2>
Revision 2
Comment: Added steps on configuring gdb and starting a debug session.

Index: GSoC2012/Android/debugging
--- GSoC2012/Android/debugging (version: 1)
+++ GSoC2012/Android/debugging (version: 2)
@@ -1,4 +1,21 @@
 = debugging native code in Android. =
+(setting this up is not needed to do java debugging, you just can't step into native functions.)
+== before starting ==
+You should at first compile the library yourself.
+Then, go to the android ndk directory. There should be a file ndk-gdb. Copy it, name the copy ndk-gdb-eclipse, and remove the following, last line:
+  $GDBCLIENT -x `native_path $GDBSETUP`
+== in Eclipse ==
+  * Open the External Tools Configuration Dialog.
+  * Add a new Program by double-clicking on Program on the left side.
+  * Select the ndk-gdb-eclipse script you just created.
+  * Select the build tab, and disable Build before launch.
+  * Hit Apply, Close.
   * (skip for Testclient) Set android:debuggable="true" in your application definition in the AndroidManifest.xml.
   * Open the debug configuration dialog.
@@ -6,9 +23,25 @@
   * This needs to be done in the main tab:
     * Enter im.pidgin.libpurple as Project name
     * Enter Android/libim.pidgin.libpurple.so as C/C++ Application name (or just click on Search project... to find it)
+    * Select Disable auto build
   * Go to the debugger tab.
     * Select gdbserver as Debugger.
     * Enter ${ndk.root}/bin/arm-linux-androideabi-gdb in the GDB debugger filed.
     * As command file, select the gdb.setup file in the native directory.
     * In the connection tab, enter TCP as connection type, localhost as target and 5039 as port.
+  * Hit apply.
+  * Create a new Launch group by double-clicking on Launch group.
+    * Add the Program launcher you created. You should set "Post launch action" to "Wait until terminated".
+    * Add your Debug configuration we just created
+    * Give it a nice name.
   * Close the dialog by hitting Apply and Close.
+== Start debugging ==
+When you want to debug native code, do the following:
+  * Add a breakpoint before initializing libpurple, e.g. in your Applications onCreate().
+  * Start your application in the normal Android debug mode. It should pause at that breakpoint.
+  * Then start your debug configuration, by clicking on Debug Configurations..., selecting the Launch group you created and hitting Debug.


* The IP shown here might not mean anything if the user or the server is
behind a proxy.

Pidgin <http://pidgin.im>

This is an automated message. Someone at http://pidgin.im added your email
address to be notified of changes on GSoC2012/Android/debugging. If it was not you, please
report to .

More information about the Wikiedit mailing list