Remote debugging with gdb / gdbserver

To remote debug using gdb:

Run the following command on the remote machine:

gdbserver :<port> --attach <pid>

gdbserver will attach to the process with the pid of <pid> and listens on <port>.

Now on the local machine,

gdb <path to binary>
target remote <remote ip>:<port>

For more information checkout the gdbserver and gdb man pages.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

w

Connecting to %s