In This article we will discuss, how to do remote debugging a C++ application using gdb debugger.

What is Remote Debugging

Remote Debugging allows the application to run on a Target machine and user can debug it on a Host Machine.


Suppose, you have a application “Dummy” , with Remote Debugging you can run this application on MACHINE 1 (Target Machine) and can debug it through MACHINE 2 (Host Machine).

How to do Remote Debugging using gdb

It involves 2 steps,

1.) Start a gdbserver:

On Host Machine start gdbserver with application to debug on a specified IP and Port i.e.



It will start the gdbserver for application “Dummy” on port 8082 and will wait for a host to connect to this on port 8082.

2.) Connect gdb from Host Machine to remote gdbserver

From the Host Machine start gdb and execute following command on gdb command prompt


It will connect this gdb from Host Machine to remote gdbserver running on Target Machine. Now on Host Machine it will show a gdb command prompt.

Now gdb from Host Machine is connected to target Machine’s gdbserver. Press “c” to continue debugging,


Click Here to Subscribe for more Articles / Tutorials like this.