<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ohad Ben-Cohen - Linux Kernel Development</title>
	<atom:link href="http://www.bencohen.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bencohen.org</link>
	<description>Free and Open Source Software</description>
	<lastBuildDate>Tue, 05 May 2009 07:34:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Remote Debugging of Android native applications with Eclipse and gdbserver</title>
		<link>http://www.bencohen.org/remote-debugging-of-android-native-applications-with-eclipse-and-gdbserver/</link>
		<comments>http://www.bencohen.org/remote-debugging-of-android-native-applications-with-eclipse-and-gdbserver/#comments</comments>
		<pubDate>Mon, 04 May 2009 06:26:23 +0000</pubDate>
		<dc:creator>ohad</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.bencohen.org/?p=16</guid>
		<description><![CDATA[I prefer plain GDB, but if want to use Eclipse, it&#8217;s possible.
Assuming the sources are located inside /home/ohad/mydroid/external/dragons,

Create a &#8220;Standard Make C Project&#8221;.
Don&#8217;t use the default location. Instead, set it to /home/ohad/mydroid/external/dragons
Don&#8217;t use the default Build command. Instead, set it to /home/ohad/mydroid/external/dragons/make_dragons
Remove the &#8220;all&#8221; from the &#8220;Build (Incremental Build)&#8221; field, and uncheck &#8220;Clean&#8221;.
Finish.

Next, create those [...]]]></description>
			<content:encoded><![CDATA[<p>I prefer plain GDB, but if want to use Eclipse, it&#8217;s possible.</p>
<p>Assuming the sources are located inside /home/ohad/mydroid/external/dragons,</p>
<ol>
<li>Create a &#8220;Standard Make C Project&#8221;.</li>
<li>Don&#8217;t use the default location. Instead, set it to /home/ohad/mydroid/external/dragons</li>
<li>Don&#8217;t use the default Build command. Instead, set it to /home/ohad/mydroid/external/dragons/make_dragons</li>
<li>Remove the &#8220;all&#8221; from the &#8220;Build (Incremental Build)&#8221; field, and uncheck &#8220;Clean&#8221;.</li>
<li>Finish.</li>
</ol>
<p>Next, create those two files:</p>
<ol>
<li>/home/ohad/mydroid/external/dragons/make_dragons
<p>#!/bin/bash<br />
ONE_SHOT_MAKEFILE=/home/ohad/mydroid/external/dragons/Android.mk make -C /home/ohad/mydroid files 2&gt;&amp;1 | sed -f /home/ohad/mydroid/external/dragons/android_sed_filter</li>
<li>/home/ohad/mydroid/external/dragons/android_sed_filter
<p># Streamlined Editor filter for Android native development with Eclipse<br />
/WARNING: adding test OTA key/d<br />
/implicitly installing apns-conf_sdk.xml/d</li>
</ol>
<p>By now, you can use Eclipse to build dragons. Let&#8217;s move on to debugging.</p>
<p>Assuming that your target IP is 10.0.0.2 and your Eclipse host IP is 10.0.0.1,</p>
<ol>
<li>Create a &#8220;C/C++ Local Application&#8221; debug instance.</li>
<li>Set &#8220;C/C++ Application&#8221; to your dragons binary, e.g., to &#8220;/home/ohad/mydroid/out/target/product/myboard/symbols/system/bin/dragons&#8221; (ignore the &#8216;CPU not supported&#8217; warning for now).</li>
<li>Choose &#8220;gdbserver Debugger&#8221;</li>
<li>Set &#8220;GDB debugger&#8221; to your toolchain&#8217;s gdb binary</li>
<li>Add &#8220;<span style="text-decoration: none;">/home/ohad/mydroid/out/target/product/myboard/symbols/system/lib&#8221; to the &#8220;Shared Libraries&#8221; list tab.</span></li>
<li><span style="text-decoration: none;">Fill up the Connection tab (e.g., TCP, 10.0.0.2, 1234).</span></li>
</ol>
<p>Everything&#8217;s in place now. Before starting a debug session, execute &#8220;gdbserver 10.0.0.1:1234 system/bin/dragons&#8221; (or gdbserver 10.0.0.1:1234 &#8211;attach &lt;PID of dragons&gt;).</p>
<p>Happy debugging <img src='http://www.bencohen.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bencohen.org/remote-debugging-of-android-native-applications-with-eclipse-and-gdbserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
