Agnel Kurian
Agnel Kurian

Reputation: 59476

Resume gdb session after parent shell terminated

I was running gdb over an SSH shell. After a while the shell disconnected due to being idle. On reconnecting I see the gdb instance still running.

  1. How do I take control of the running gdb instance?
  2. Can I start a new gdb instance and take over the session from the running gdb instance?

Note: This is not about keeping the SSH session alive. This is more about taking control of gdb from another shell instance. Regardless of whether it is running from SSH or locally.

Upvotes: 1

Views: 1219

Answers (1)

Bob Shaffer
Bob Shaffer

Reputation: 655

You probably can't do anything with the gdb that is already running. It probably no longer has a controlling tty at all. What you probably want to do is kill it and then start a new gdb process, but do it inside a program like tmux or screen. If you do that, then if/when you get disconnected you can easily reattach to the tmux/screen session any time. Just check out the manual for those programs. They do pretty much the same thing. I think tmux is a little more powerful.

Upvotes: 1

Related Questions