1

I run gdbserver gdbserver --attach :<port> <pid> and then connect with gdb-multiarch

The problem is that until I connect with gdb-multiarch and run c the process is stop.

Can I continue the process after I attach with gdbserver inside hte machine that run gdbserver ?

1 Answer 1

3

The main built-in way I see to do this is to use gdbserver --multi without attaching to a process at that time. Then, you connect with target extended-remote in gdb, and then run the attach <pid> in gdb.

You could also instead use a wrapper on the debugee to not start gdbserver until a connection is made:

$ socat tcp-l:<port>,reuseaddr,fork exec:"gdbserver --once --attach <pid>"

Statically compiled builds of socat can be made by you or often found online.

2
  • , I looking for a way into server machine ,not into client machine. I just don't want that process will wait until gdb-multiarch will connet
    – func
    Jan 22, 2021 at 9:08
  • Ok, edited and gave two options. Jan 22, 2021 at 12:17

Your Answer

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

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