Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDT need to provide console/terminal emulator for gdb inferior. #187

Open
xu-chiheng opened this issue Nov 29, 2022 · 6 comments
Open

CDT need to provide console/terminal emulator for gdb inferior. #187

xu-chiheng opened this issue Nov 29, 2022 · 6 comments

Comments

@xu-chiheng
Copy link
Contributor

CDT can use PTY to connect the running program, by it provide no way to connect the gdb inferior.

A solution is to use a patched native terminal emulator like mintty(Cygwin and MSYS2/MinGW) or konsole(KDE), to call openpty() instead of forkpty() to allocate a pty, and output the device name of the pty slave, then CDT pass that slave device name(/dev/xxx) to gdb through --tty option.

--tty=TTY Use TTY for input/output by the program being debugged.

This has been realized in UltraGDB(https://github.com/ultragdb/ultragdb).

@jonahgraham
Copy link
Member

Running processes in a terminal instead of the Eclipse Console is a good idea and I fully support work to get there. There have been quite some changes in CDT since ultragdb's fork point (new-ui, removal of old debug interface, terminal and remote code depending on process launching, etc) that need to be taken into consideration (as discussed in #180)

Presumably you are proposing this as a new option in launch configurations? Does it require configuration, or just a checkbox?

Ideally I would like this change upstream (in Eclipse Platform Debug), but there are challenges to making that happen, especially that the integrated terminal would probably need to move upstream too. The ideal place would be:

image

Looking at ultragdb's code, it has a fork on mintty, I don't think the Eclipse CDT project is interested in maintaining such a fork. Is the same true for konsole? Added into that mintty is GPL I think this is a non-starter.

Are you planning on upstreaming your changes to mintty/konsole?

@xu-chiheng
Copy link
Contributor Author

Yes, as a new option launch configurations, just need a checkbox.

Yes, I'm upstreaming mintty/konsole.

mintty patch is ready to upstream.
mintty/mintty#1187
https://github.com/xu-chiheng/mintty/commit/f0e80e1876502a83c8e5d1b5c24a4c714a0b0e18

@jonahgraham
Copy link
Member

Cool. Did you see that mintty has a contribution policy that says no unsolicited PRs. I wonder if we had such a policy in CDT we could have wasted less of your time yesterday?

@xu-chiheng
Copy link
Contributor Author

xu-chiheng commented Nov 30, 2022 via email

@jonahgraham
Copy link
Member

My question was " if we had such a policy in CDT we could have wasted less of your time yesterday?"

@xu-chiheng
Copy link
Contributor Author

understood

jonahgraham pushed a commit that referenced this issue Dec 3, 2022
…tion. (#188)

* refactor ProcessFactory.java to put all process creations in one function.

Prerequisite of #187

* add missing $NON-NLS$ tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants