1

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

Gdbserver command: gdbserver --multi 0.0.0.0:4444

Gdb command: target remote 192.168.1.99 4444

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

1 Answer 1

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 0.0.0.0:44444 --attach <PID>

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

attach <PID>

Spawn the process with GDB server

gdbserver 0.0.0.0:44444 <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, privacy policy and cookie policy

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