-
Notifications
You must be signed in to change notification settings - Fork 67
Debugger not stopping at breakpoints with virtual environment #2096
Comments
Can you try enabling the experimental debugger, and see if that makes any difference for you? |
@MarkBaggett These settings should be added to user settings not "python.experiments.optInto": [
"DebugAdapterFactory - experiment",
"PtvsdWheels37 - experiment"
] |
@MarkBaggett Thank you for sharing the gifs. These are really helpful. When you look at the debugger path, it still shows |
Does this help? Does the roaming profile have something to do with this problem? |
My apologies, the notification slipped through. @karthiknadig, is there anything else that could possibly be the reason why it keeps using the old debugger? Telemetry? |
@MarkBaggett can you provide the logs for the run where the breakpoint is not being hit? i.e.:
|
What is happening is that with the setting i.e.: this can be seen by the response to the set breakpoints:
And the settings also show:
@karthiknadig @int19h should this actually work? i.e.: I don't remember doing any special treatment for the case where -- I think that the usual case is having |
The upside is that you are definitely using the new debugger now! It looks like breakpoints get excluded by path filters for some reason:
One thing that looks off to me is the path to interpreter:
This implies that You can override that with
|
Yep. That is exactly what is going on. I really had no idea that the debugger automatically ignored everything in the virtual environment folder. Id like to think I'm not the only person dumb enough to make this mistake. (If I am please just smile and close the ticket) ;) Perhaps a warning or something if it main program is in an excluded directory would be useful. I very much appreciate you taking the time and helping me. I also very much appreciate Microsoft making this excellent software available for free and providing support! Thank you. |
Oh.. And for your reference. The only thing I changed between "Not running the correct debugger" and "You are now running the correct debugger" was that I checked the two telemetry boxes. They were unchecked previously. |
The debugger does try to report those breakpoints as not verified, with the message pointing at "justMyCode"... but this doesn't get surfaced prominently in UI. I think if the program were running long enough, you'd see the breakpoints look disabled, and hovering over them would show the message, but in this scenario, it's all over before you have a chance to even notice any of that. I think we might also be printing that error in Debug Console at the bottom? But it doesn't get focus by default. We could certainly diagnose this specific scenario - Can you file a separate issue on https://github.com/microsoft/vscode-python for better diagnostics? |
Issue Type: Bug
SYSTEM SETUP:
Host Windows 10 Home Edition
Environment Information: Python 3.8.1
Version: 1.42.1 (system setup)
Commit: c47d83b
Date: 2020-02-11T14:45:59.656Z
Electron: 6.1.6
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18363
TO REPRODUCE:
Step 1: Create a Virtual environement and activate ( I have tried both venv and virtualenv. They both produce the same error).
Step 2: Try to debug a program.
Create a python program (I created as simple loop with a print statement) and put break points on every line.
When the interpreter is set to the MyVirtualenv:venv it will not stop at breakpoints. When it is set to the main system interpreter it does. (But no modules are available.)
Nothing special about launch.json. (I did try turning on stop on entry and that didn't work either)
Integrated Terminal Output:
There is this (perhaps unrelated) error in be CONSOLE tab of the developer tools that looks suspicious to me.
Expected behaviour
Stop at breakpoints
Actual behaviour
Not stopping at breakpoints
The text was updated successfully, but these errors were encountered: