-
Notifications
You must be signed in to change notification settings - Fork 256
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
[Rust] no stderr stream #948
Comments
Friendly ping @vadimcn ~ No pressure, just want to make sure this issue is not missed somehow :) |
These lines are output by cargo, not by the debuggee. You can still see the first one in the terminal used to execute cargo. The second one is, of course, not output, since we pass |
Thanks, may I ask some more questions?
|
Normally, cargo compiles and then immediately runs the unit tests executable. This is not suitable for debugging, we want the debugger to be the immediate parent of the debuggee process. A secondary problem with cargo is that it generates pseudo-random names of the test executable, so we cannot simply specify it's name in
Why are you trying to do this as a part of a debugging session? |
Thanks for the details.
I do not need it as part of a debugging session, I just need the output, but the output is managed by the debugging session(or in fact, LLDB, if I understand it correctly). Here is the background: We need to know the result of a running of test, and for now, we do it through analyzing the output.(not taht good, but we have not choice, because rustc does not provide any callback mechanism) If user clicks "Run" button, it's good, we could run cargo and redirect stdout/stderr through js. But if user clicks "debug" button, there is not much we could do but relay on this plugin. And I need all of the output of cargo to decide which test was ran if user runs all tests under workspace/package level. Because the test case might have same name, although they are under different targets. |
If I were you, I wouldn't try to intercept all possible ways of executing tests. Updating test results only when the user clicks 'Run' seems entirely reasonable. After all, you can't know whether test execution was tampered with while debugging (by altering the values of variables and registers, skipping over statements, etc).
BTW, if you aren't already, you should be using cargo's |
Good point, it should help, thanks! |
VSCode Version: 1.78.2 (user setup)
OS: Windows_NT x64 10.0.22621
CodeLLDB version: 1.9.2
Compiler: cargo 1.70.0-nightly (0e474cfd7 2023-03-31)
Debuggee: x86_64-windows
Problem: The output from stderr seems disappear.
How do I get there: It's by default I think, although it is weird, because this lib is popular and no one report it.
When debugging test by using "cargo test some::test::path",
the output should be like
However, when I use some config like
{ "type": "lldb", "request": "launch", "name": "Debug unit tests in library 'hashbrown'", "cargo": { "args": [ "test", "--no-run", "--lib", "--package=hashbrown" ], "filter": { "name": "hashbrown", "kind": "lib" } }, "args": [], "cwd": "${workspaceFolder}" },
The output does not contain the content from stderr.
And when I want to redirect though stdio, like
stdio: [null, "tmp1.txt", "tmp2.txt"]
, the tmp2.txt(the content of stderr) is empty.Verbose log
The text was updated successfully, but these errors were encountered: