Closed cs01 closed 4 years ago
I am able to create two ptys: one for the user to interact with, and another for the UI to interact with by using an mi2 interpreter. I first create a pty for mi2 protocol. I get its path (such as /dev/pts/19) then run cat
in it. Next I create another pty and run gdb in it, and run the command new-ui mi2 /dev/pts/19
. At this point I expect to be able to write arbitrary mi2 commands to /dev/pts/19, and parse mi2 responses from it, but it doesn't really work. Occasionally a message is read from it, but nothing seems to happen when I write to it. Any ideas where I am going wrong here? Should I not be running cat
?
You can test this with gdbgui commit 2621c26b3d (branch cs01/use-pty), and pygdbmi commit 535522b99f71e1 (branch cs01/refactor).
The user-facing terminal works pretty well; it's just a matter of getting the mi2 messages passed back and forth to keep the UI in sync.
I don't have time to look at your code right now, but I just wanted to point out that this is used (and works) for cdt-gdb-adapter:
So there's hope :)
Thanks! Got it working. I had two threads competing to read from the pty at the same time.
Your link did give me more confidence that I wasn't wasting my time and there was a solution though 😄
Nice :). I'll have to try it.
It would be great to get some folks testing it before it's released! I'll let you know when it's ready for testing.
Is your feature request related to a problem? Please describe. The frontend terminal is not truly interactive. gdb behaves differently when it is connected to a terminal and will prompt and wait for user responses rather than assume things and carry on.
Describe the solution you'd like A fully interactive terminal with gdb in the frontend. xterm.js can be used to render the terminal, and Python pty's can be used on the backend. One will be created for the user to interact with, and another for the UI to send/receive gdb's mi2 messages.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context https://xtermjs.org/ can be used to render the terminal in the frontend.
The
new-ui
command can be used to split I/O between the UI for the gui and the terminal for the user. https://sourceware.org/gdb/onlinedocs/gdb/Interpreters.html