When I run gdbserver to listen for port and connect remotely with gdb:

Gdbserver command: gdbserver --multi

Gdb command: target remote 4444

In gdb . How can I connect to pid with pidof(PROCESS_NAME) ?

1 Answer 1


You have two options there, you could attach to a running process with GDB server or spawn it.

Attach to a running process

gdbserver --attach <PID>

or run GDB server and then from the connected GDB client lunch

attach <PID>

Spawn the process with GDB server

gdbserver <program> <args>

If you need a list of running process on the remote machine, you can lunch info os processes from your GDB client once connected to the remote server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.