Skip to content
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

Multi-line "Evaluate in Debug Console" fails to store intermediate variables. #932

Closed
CmpCtrl opened this issue May 11, 2022 · 5 comments
Closed

Comments

@CmpCtrl
Copy link

CmpCtrl commented May 11, 2022

Issue Type: Bug

Behaviour

Expected vs. Actual

When debugging and stopped at a breakpoint inside a function, using Evaluate in Debug Console on a multi-line selection executes OK, but fails to store intermediate variables. I expect it to store all of the intermediate variables as if the code were run normally.

Steps to reproduce:

Set a breakpoint in a function and debug. When stopped at the breakpoint highlight several rows, right-click, and select Evaluate in Debug Console.

In this example you can see that the debugger executed OK but only f was stored in the locals. I expect a thru f to be stored.
image

Sample script to reproduce:

import numpy as np


def main():
    """main"""
    a = np.random.rand(100)
    b = np.random.rand(100)
    c = a + b
    if a.any():
        d = np.random.rand(100)
        e = np.random.rand(100)
        f = d + e


if __name__ == "__main__":
    main()

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.2
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Pylance
User Settings


defaultLS: {"defaultLSType":"Pylance"}

downloadLanguageServer: true

envFile: "<placeholder>"

venvPath: "<placeholder>"

venvFolders: "<placeholder>"

condaPath: "<placeholder>"

pipenvPath: "<placeholder>"

poetryPath: "<placeholder>"

languageServer: "Pylance"

linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: true
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: false
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"

sortImports
• args: "<placeholder>"
• path: "<placeholder>"

formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "black"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"

testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: false
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true

terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"

experiments
• enabled: true
• optInto: []
• optOutFrom: []

tensorBoard
• logDirectory: "<placeholder>"

Extension version: 2022.6.1
VS Code version: Code 1.67.0 (57fd6d0195bb9b9d1b49f6da5db789060795de47, 2022-05-04T12:06:02.889Z)
OS version: Windows_NT x64 10.0.19044
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz (12 x 2712)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: unavailable_off
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.61GB (15.80GB free)
Process Argv --crash-reporter-id e55d3703-d7b2-409d-9ef3-d55e0fc5446e
Screen Reader no
VM 0%
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python May 12, 2022
@fabioz
Copy link
Collaborator

fabioz commented May 12, 2022

This should be fixed in main already (duplicate of #915).

@fabioz fabioz closed this as completed May 12, 2022
@CmpCtrl
Copy link
Author

CmpCtrl commented Jun 17, 2022

@fabioz when might this fix make it into a release? The issue is still present with the following versions.

Let me know if i am missing something. Thanks.

vscode: 1.68.1
python: 2022.9.11661004
vscode-pylance: 2022.6.20

@int19h
Copy link
Contributor

int19h commented Jun 17, 2022

There haven't been any debugpy releases since the fix went in, hence why it's not in VSCode yet. We don't have a specific schedule for releases; they happen once enough fixes have been accumulated. But you can keep track on them on the Releases tab in this repo, or on PyPI.

@CmpCtrl
Copy link
Author

CmpCtrl commented Jun 29, 2022

Any update on when there may be a release with this fix? Or maybe a hint on how to run a more recent commit in vscode? Thanks,

@fabioz
Copy link
Collaborator

fabioz commented Jun 29, 2022

@CmpCtrl not sure about the release timeframe, but you can use the current version in main if you'd like by doing the following:

Clone this repo:

git clone https://github.com/microsoft/debugpy.git
cd debugpy
pwd

Then, in your launch config add:

"debugAdapterPath": "<pwd path>/src/debugpy/adapter"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants