-
-
Notifications
You must be signed in to change notification settings - Fork 799
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
Debugger does not honor selected environment #4098
Comments
I don’t remember, do we provide different debug profiles when you switch to Debugging activity? |
I'm not sure I fully understand your question. But the below information might answer it. If you change A configuration in
Note that the selected environment is part of the executable path and the board type also affects svdPath. So the selected environment is very relevant. |
platformio/platformio-vscode-ide#2018 (comment) You will also need the latest PlatformIO Core 5.0.3 Dev. Does it work now? Thanks! P.S: Also would be thankful for the feedback with upcoming chnages in 2.2.0. |
I've jus tried it and it didn't work. The correct environment was used to build a debug version. But the debugger is then started with a different (incorrect) environment.
Strangely enough, it looks as if the target was build twice: the output of the correct one appears in the TERMINAL view, the output of the incorrect one appears in DEBUG CONSOLE. |
Do you use the latest PlatformIO Core 5.0.3 Dev? |
Yes, I do. And I'm having more troubles. On a project with a single environment, I can't start the debugger anymore. I always get the error message "Could not find the specified task." This is new. It has worked before I upgraded to the development version. And I don't know if it is related... Quite often Build and Upload in the status bar don't work. Instead of executing something, they just display a pop up (the kind VSC displays to let you select something): This isn't new. It has occurred from time to time since the environment selector in the status bar was introduced. The workaround is to again select the already selected environment from the status bar. |
Keep PlatformIO IDe extension at 2.2.0-beta and downgrade PlatformIO Core to the latest stable 5.0.2. I'll try to investigate this issue. Another workaround is to use |
I have been using the new core 5.0.3a1 but the old extension (2.1.3). How do I upgrade to the beta version? |
See instruction by a link above. Thanks. |
2.2.0 has been released! You will just need the latest PIO Core 5.0.3-dev. |
It looks good. For the first time, debugging the selected environment works. Thanks. The "No configured task..." pop-up didn't appear anymore. I hope it has been fixed for good. I can still generate the "Could not find the specified task." error. It seems to be related to currently open file in the editor. The error occurs if a file from another project is open. The solution is to open a file from the project to be debugged (or bring the file to the front). |
VSCode consumes tasks depending on the active project. We don’t rebuild index every time. It seems that we should provide debugging configuration using VSCode API and not use launch.json. Other solution is to revert back PlatformIO Core and use a base pre-debug task. |
Also noted as a bug in community thread |
THANK YOU I moved to "platformIO dev" branch and I also checked that I had the latest "PlafformIO IDE" extension installed. Moving to the dev branch, solved my "Error could not find specified task" Thankyou! |
I still have this problem. I am poking around because I get the annoying full double rebuild when debugging. |
@dzid26, could you share your |
I am using this normally.
I think the problem is related to how |
See https://github.com/platformio/platformio-core/blob/develop/platformio/debug/helpers.py#L65 Does it makes sense to set "Environment Switcher" to "Auto"? |
This function seems to be ignored by the debug console. I am not sure but I think only CLI uses Terminal uses https://github.com/platformio/platformio-core/blob/develop/platformio/debug/helpers.py#L65. |
@dzid26, thanks, I reproduced this issue. This is a bug and is different from this issue. Could I ask you to open a new issue at https://github.com/platformio/platformio-core/issues to track this problem? |
The new environment switch in the status bar is a welcome enhancement. Unfortunately, it is not honored by the debugger. Instead, the debugger uses the first environment or the one selected by
default_envs
.As the environment switch applies to IntelliSense and the Build and Upload actions in the status bar, users expect that the debugger behaves the same. I did so too.
In my case it even lead to a very confusing situation:
I see two options to fix it:
launch.json
) such that it is obvious which one is usedThe text was updated successfully, but these errors were encountered: