-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Breakpoints fail on worker threads #1385
Comments
@weswitt So you set a breakpoint, it gets hit on a thread other than main and the debugger doesn't have the right thread in context? |
Can you also tell me if you are doing gdb <-> gdbserver or SSH remote to gdb debugging? |
Correct, the thread context is wrong. You can't step or examine locals. { |
when you say it is wrong, does it have the wrong stack line selected on the wrong thread or is it not showing which thread is selected? When you say you can't examine locals, what are you seeing? I tried this with my multithreaded app sample that's in this repo and I am seeing the right thread selected with the right frame and values in my locals window. You can try this sample app too and see if you see the same behavior: https://github.com/Microsoft/vscode-cpptools/tree/master/Code%20Samples/Fib. If you don't can you provide me a repro application so I can debug the exact scenario? |
@weswitt That picture shows it still is running (isn't in breakmode) so locals/callstack should not show anything. If its supposed to be at a breakpoint, then we aren't getting the right event. If you enable |
The process has stopped at the bp. Look at the debug console. It says hit Breakpoint 3" and I know for a fact that it did because I caused to do so. |
If you enable logging, we can see what gdb is sending back to us when the breakpoint is hit. I suspect something that it is sending isn't being processed correctly and therefore we don't know that it is stopped. What is happening here is we don't know that the breakpoint is hit and we aren't notifying VSCode that a breakpoint is hit and it should be in stop mode. |
Thanks you. How do I enable GDB logging? |
Add |
I think what is happening is that it is stopping before the BP hits and is not continued: =thread-selected,id="5" |
that stopped event reason "solib-event" says it is a library load event that caused it to stop. Stopping on library load events should be disabled at this point. Can you provide more of the log? |
Here is more. Coping text from the console is not easy at all. Would be nice if the log could be directed to a file. 1: (1591) -> |
Further diagnosis shows that this is caused by the debugee outputting text to STDOUT. It seems that if enough text from other threads than the thread being debugged can cause this. If I disable my apps logging to STDOUT then the debugger behaves correctly. I suspect that when debugging remotely the timing / slowness is different enough from the faster local scenario that this happens. |
@weswitt Enabling logging to a file is a little bit more involved. To do it, open |
I'm interested in seeing if calls to When you say you are outputting text to STDOUT, how much text are you generating? |
@weswitt i'm still unable to reproduce this. If you can provide me a sample app, please let me know. |
Thank you for reporting an issue. We do not have enough information at this time to act upon this issue. Please try our latest version and if it is still occuring, provide more information including configurations, logs and version information and reopen this issue. |
Running VsCode 1.19.1 & C/C++ Version 0.14.5 on Windows 10. Attempting remote debugging to an Ubuntu 16.04 machine using GDB. Debugging does work, but breakpoints on threads other than the main thread do not work properly. The breakpoint is hit, but when it does so the debugger does not switch threads and set the context correctly. The debugging is useless because of this.
Attempting the same thing locally on the same Ubuntu machine works so this seems to be a remote debugging specific bug. This appears to be a regression as this used to work correctly.
The text was updated successfully, but these errors were encountered: