How to Compile Android’s gdbserver

Download source code from and place it into local computer as follow:



Modify the shell script in C:\NDK\build\tools as follows for placement of build workspace:


To use the latest version, you can set the DEFAULT_GDB_VERSION shell variable as follow:


Activates bash shell and enter the command below:


Assuming that NDK is located at C:\NDK, and the script starts to roll on, sit, relax, and pray 🙂

Seems my prayer is not answered by God, because I’ve these error messages in seconds as below:


Checking at the said directory, this is what I only got:


So, I abandoned my desire to try to compile to highest version of gdbserver, and reverted back to version allowed by NDK framework. This is done by commenting out the DEFAULT_GDB_VERSION above. Maybe later I will use it after downloading latest Android NDK.

Execute the script, and crossing finger again. It took about several minutes rolling now, but oh no. It stops again:


So, lets examine thinking process behind make, but to cut the time short, let’s skip the configuring process and goes straight thru make phase:


In the generated file we have:


The config.status file already sits nicely in the build directory, but where the hell is file ? Because the purpose is to build gdbserver, so I assume I should get this file from D:\Projects\Android\toolchain\gdb\gdb-7.3.x\gdb\gdbserver and place it into the build directory.


Again, copy configure file from gdbserver directory.


Feeding at what it needed, I arrive at:


After several complains about the files, then I realized, that I should copied the entire folder from D:\Projects\Android\toolchain\gdb\gdb-7.3.x\gdb to D:\Projects\Android\toolchain\gdb\tmp\myndk\build by leaving the generated gdbserver alone with directory structures as follow:



The source of the above folder is from D:\Projects\Android\toolchain\gdb\gdb-7.3.x\gdb and the rest of files inside gdbserver folder such as inferiors.c etc, is copied from D:\Projects\Android\toolchain\gdb\gdb-7.3.x\gdb\gdbserver.

By performing the make again, the gdbserver for Android is at last in my hand 🙂




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: