-
Notifications
You must be signed in to change notification settings - Fork 42
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
Cannot read from stdin (with openGdbConsole on) #158
Comments
I think in this case you have suspended in the middle of read.c, but you don't have read.c on your computer (at least not where GDB can find it). So the debug adapter is reporting back the current stopped location as .../read.c and VS Code is trying to open that file. It is VS Code that is giving that error. If you install (or have) the source for glibc then you can use The debug adapter could (should) be made to fail more graciously in this case and suggest some solutions - such as mapping source locations, or offering to fall back on disassembly or ??? |
@jonahgraham
So IMHO, it seems that gdb is able to locate read.c on my computer, right? A gif is posted below in case my explanation is not clear enough: What's your opinion on this? Do you have any further advice? |
In your original post your gdb stopped because of a signal. Where it stopped was in read.c. You have highlighted an interesting question that I hope @marechal-p can comment on, why did vscode's terminal send a SIGTTIN in the integrated case but not when running gdb on its own? |
PS I have not tried to replicate. I'll try to tomorrow - it's getting late here. |
@jonahgraham Thanks for your comment. And there's another information you might find useful: I could reproduce it in theia. |
@marechal-p Hi, Paul, do you have any clue for fixing this problem? Thank you very much! |
I was trying to read about ttys and this SIGTTIN, apparently this is dispatched to processes running in background process groups when they try to interact with the master tty. Is it related to the way we create a new tty and hook GDB onto it? I am a bit short of ideas at the moment... |
Hi @marechal-p - thanks for the insights. I think that @a1994846931931 is running into problems no one else has much because most everyone else is doing embedded which doesn't have an inferior in the same way. |
@jonahgraham @marechal-p I was able to get rid of the SIGTTIN error by executing gdb command Do you have any suggestions on this? |
I attempted to debug a program through a
gdb console
(setopenGdbConsole
totrue
) so that the program could read from stdin. But there's an error as shown below:I'm just wondering if it is a bug of
cdt-gdb-adapter
, or am I just making a mistake? I tried to make things right, but only to find out that it's really hard to fix. Could anyone give me some advice?Thank you very much!
The text was updated successfully, but these errors were encountered: