Last night I was debugging with GDB. The GDB is a remote Red hat machine, and I log into with putty. I didn't finish my debug last night, and I left.

But this morning when I come back ,the PuTTy is disconnect with the Ret Hat Shell, and I login the Red hat machine, find that the GDB is still runnning, but I am not in the same shell as the one in last night. How can I still use that GDB instance to keep my debugging. I don't won't to restart the whole program since it takes much time to build and run.

  • You tagged gnu-screen, which along with tmux, would have saved you, if you started your original session with them. – Jeff Schaller Jun 27 '17 at 2:09

Use a multiplexer like tmux or screen on the remote site.

In the case you use tmux:

When logged in on the remote site with putty simply start the multiplexer by executing tmux. Disconnect from tmux multiplexer by pressing CTRL-b d, than disconnect putty. When returning to the remote site list your tmux session with tmux ls and reconnect with tmux attach.

There are a lot of features to secure your session so read the contents of the links above.

I don't know a way to reconnect to your already started debugging session, so this is an advice for next time also.

  • If this is what you were looking for it would be nice, if you accept my answer. ;) – ChristophS Jun 27 '17 at 10:09
  • I'll give an upvote, and pend it for an answer for some days. :) – EvanL00 Jun 28 '17 at 3:46

(advice for next time) Try using nohup


You can also set the heartbeat / keepalive on putty to a greater number than 0:


  • nohup won't help if the network layer connecting to the shell session has closed – roaima Jun 27 '17 at 8:10

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.