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

Can not wait for user input #262

Open
jgueytat opened this issue Mar 24, 2021 · 17 comments
Open

Can not wait for user input #262

jgueytat opened this issue Mar 24, 2021 · 17 comments

Comments

@jgueytat
Copy link

jgueytat commented Mar 24, 2021

$ gdb --version
GNU gdb (Debian 8.2.1-2+b3) 8.2.1

I get the program running properly with the terminal.
In VSCode the prorgam does not wait for the user input.

Started
Cancelled
Terminal

@jgueytat
Copy link
Author

gitpod-io/gitpod#3566
May be the report should go on VSCode side.

@jgueytat
Copy link
Author

I was only able to get the user input properly with ms-vscode.cpptools locally with VSCode for now.

@jgueytat
Copy link
Author

Same behavior there : eclipse-cdt-cloud/cdt-gdb-vscode#43

@GitMensch
Copy link
Collaborator

You you please re-run with showDevDebugOutput: true set for this extension and then post complete debug-log output?

@GitMensch
Copy link
Collaborator

I think this is related to the use of this.process.stdin.write within the sendRaw command; or actual, the use of sendRaw in the sendCommand function. @WebFreak001 is there a reason to not use sendCliCommand (so interpreter-exec internally) for nearly everything we currently use sendCommand for?

@WebFreak001
Copy link
Owner

hm the commands not starting with a - should be run through interpreter-exec because that makes it feel more like a GDB console, good for people who are used to it.

However I don't think that is related to this problem at all, that input afaik isn't being piped to the program directly usually. You can try launching the program in separate terminal mode, which makes it pop up a console window that does the std io handling.

@GitMensch
Copy link
Collaborator

However I don't think that is related to this problem at all, that input afaik isn't being piped to the program directly usually.

But the code suggest it does:
We have internal use of sendCommand 20 times (7/8 times during startup [ssh/normal, both using a 5 commands init function, leaving 10 more invokes open afterwards]).

So the startup here takes 8 stdin.write during startup and potentially 10 others later (likely one before, too).
If the application gets to the user input before those 8 commands are finished on the GDB side then we still have an "input" open in this case.

For me the main question is really: why use stdin.write at all?

@GitMensch
Copy link
Collaborator

Friendly ping @WebFreak001 because this really bugs me - as long as the program running is accepting input it should get through via stdin - and to allow that the extension should never send data there to communicate with GDB, shouldn't it?

@WebFreak001
Copy link
Owner

feel free to replace calls to sendRaw with sendCommand if they come from the extension and using -interpreter-exec

User input to the debug console should still support GDB commands if given as is and MI commands when starting with -

@jgueytat
Copy link
Author

Hi guys,

I can get the getChar with the 25.1. The only thing is that I get a "Cancelled" in the Debug console at the end of the execution.

@jgueytat
Copy link
Author

GitPod has still trouble with that.

image

@jgueytat
Copy link
Author

jgueytat commented Nov 29, 2021

Version : v25.1

With VSCode I can still miss the getChar() but it seems far much better.

image

@jgueytat
Copy link
Author

With a recent GitPod Workspace : https://coral-puffin-q8gr472u.ws-eu17.gitpod.io

I miss the getChar and the breakpoint.

image

@jgueytat
Copy link
Author

Here I got the getChar with the Hello lines at once.

image
image

@WebFreak001
Copy link
Owner

I don't think the fix for this has been released yet, but it should be there on master.

@jgueytat
Copy link
Author

Thanks for the reply @WebFreak001! May be we could add on the main README.md the latest published versions on the markets.

@GitMensch
Copy link
Collaborator

That should be fixed now, no? An external console would obviously make that easier in any case, but that's a different issue.

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

3 participants