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
Windows debugging fails to redirect stdio sometimes #400
Comments
CodeLLDB runs a copy of itself in the terminal to figure out which console to attach stdio to. This information is then communicated back to the main instance via that second port you are seeing (the first port is where VSCode attaches to control the debug session). Do you see this "terminal agent" instance starting in the terminal? Does it report any errors? I've seen reports of this behavior before, but was never able to reproduce locally. I was not able to compile the breakout example because of some errors about missing "__GSHandlerCheck_EH4" symbol, but I doubt it's related to a specific debuggee, and more likely something to do with debugger startup timing. |
I'm experiencing this exact issue with a bevy project too. The odd thing is that in two of my projects this does not happen but in other projects it does. I've tried switching between nightly and stable rust, recompiling, reloading, all terminal settings, nothing seems to be able to fix this it just... happens to some projects and not others. I could not tell you the difference other than that they're different projects in different locations configured exactly the same Edit: I tried creating a completely fresh project and this seems to happen only when I add the DefaultPlugins, but I also add those in the projects where it works correctly, so I'm pretty stumped at what could cause this to happen Edit 2: It started randomly working after I commented out some code, got a panic on run, added the code back in, and now it works. Seems like this might be a really convoluted edge case |
Just fixed something while investigating another bug, wondering if it was the root cause of this one as well. Can you try this build? |
Can confirm it's happening with MSYS Clang 13.0.1 and CodeLLDB 1.7.0. Having a working cout is almost impossible. |
OS: Microsoft Windows Version 2004 (OS Build 19041.685)
VSCode version: Visual Studio Code Version 1.52.1 (system setup)
Extension version: v1.6.0
Compiler: rustc 1.50.0-nightly (b32e6e6ac 2020-12-16)
Build target: x86_64-pc-windows-msvc
When debugging Bevy games, stdio is failing to be redirected (terminal agent did not respond within the allotted time). (Side note: because of #380, the debug console says "Debugee output will appear here", but it doesn't, as debugee output is going to the LLDB log exclusively.) Interestingly, the LLDB log says
Listening on port 55372
, and command history in the terminal shows that it was attaching to--port=55375
?Debug Log
Output (LLDB)
This can be most easily reproduced by cloning the bevy repo and running the breakout example via the debugger.
This does not seem to be an issue for smaller projects, so perhaps this is related to startup time? My trivial playground works just fine (there
Listening on port 55492
and--port=55494
it seems, so that's not the issue, I suppose.)Debugging itself seems to work fine, it's just the stdio redirection that is not working.
(Panic in bevy example is due to working directory shenanigans, and is more likely a bevy issue.)
The text was updated successfully, but these errors were encountered: