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,


Python Recommendations:

C++ & C++11 Recommendations:

If you didn't find what you were looking, then do suggest us in the comments below. We will be more than happy to add that.

Subscribe with us to join 1500+ Python & C++ developers, to get more Tips &  Tutorials like this.