Bug 497166 - [console] Support the user using the 'run' command in the gdb console
Summary: [console] Support the user using the 'run' command in the gdb console
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 497636 303808
  Show dependency tree
 
Reported: 2016-07-01 19:27 EDT by Marc Khouzam CLA
Modified: 2020-09-04 15:20 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam CLA 2016-07-01 19:27:30 EDT
Currently, if the user types 'run' in the gdb console to restart the process, things fail in eclipse.  The main reason is that gdb is unable to restart the process because it tries to use the same TTY as for the original process, but that TTY is now closed.

There are some cleanup also needed in the handling of exited processes in eclipse to properly support this.

I was thinking of multiple approaches we can take to solve the tty issue:

1- once the process is started, immediately unset the tty in gdb.  A restart should then work.  There are two issues there though: first, there does not seem to be a way to unset the tty in GDB!  This can easily be fixed for gdb, but wouldn't help with old versions.  Second, the output will not go to an eclipse console.

2- we could extend the CDT PTY class to remain open even after the process it was associated too disappears.  We could then re-use the PTY each time the process is restarted.

3- once the process is started, immediately allocate a new PTY and set it in GDB.  That way, if the user types 'run' a new PTY would be ready.

There are surely other approaches, but I think #2 or #3 are pretty good and do-able.  I think #3 is better because we don't fiddle around with the PTY itself.
Comment 1 Eclipse Genie CLA 2016-07-01 21:48:04 EDT
New Gerrit change created: https://git.eclipse.org/r/76462
Comment 2 Eclipse Genie CLA 2016-08-18 13:15:54 EDT
New Gerrit change created: https://git.eclipse.org/r/79284
Comment 3 Marc Khouzam CLA 2016-08-18 13:19:58 EDT
(In reply to Eclipse Genie from comment #2)
> New Gerrit change created: https://git.eclipse.org/r/79284

Pushed a new review by mistake, instead of reusing the existing one.
I've abandoned this new one.