microsoft / vscode-python-debugger

Python debugger (debugpy) extension for VS Code.
https://marketplace.visualstudio.com/items?itemName=ms-python.debugpy
MIT License
40 stars 17 forks source link

Single-stepping through third-party libraries during debugging is not possible #359

Closed devymex closed 2 weeks ago

devymex commented 3 weeks ago

Type: Bug

Behaviour

When justmycode is enabled, When justmycode is enabled, single-stepping through third-party libraries during debugging is not possible.

When I press F11 from my program to step into a third-party library, the current cursor indicator (yellow arrow) remains pointing to the call line in my program. A green arrow appears next to the actual current line in the called position within the third-party library. At this point, the CALL STACK window still shows the current module as being in my program. Even if I click on the third-party library module (which is at the top of the stack), I cannot 'activate' the current line in the third-party library module (the green arrow does not turn yellow). This issue prevents me from continuously stepping through the third-party library code with F10, forcing me to switch back and forth between my files and the third-party library code files, significantly impacting development efficiency.

Steps to reproduce:

  1. My launch.json:
    {
    "version": "0.2.0",
    "configurations": [
        {
            "name": "debugpy",
            "type": "debugpy",
            "request": "launch",
            "program": "test.py",
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}",
            "env": {
                "PYTHONPATH": "${cwd}"
            },
            "justMyCode": false
        }
    ]
    }

My code:

import numpy as np
from PIL import Image

img = Image.open('test.jpg')
print(img)

bug

Extension version: 2024.6.0 VS Code version: Code 1.90.0 (89de5a8d4d6205e5b11647eb6a74844ca23d2573, 2024-06-04T19:43:07.605Z) OS version: Linux x64 5.19.0-41-generic Modes: Remote OS version: Linux x64 5.4.119-19.0009.28

Item Value
CPUs 11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz (16 x 800)
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
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 1, 1, 1
Memory (System) 31.06GB (24.93GB free)
Process Argv --crash-reporter-id 681870e4-3d75-4e81-a92c-21878a28d682
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
Item Value
Remote SSH: h800-tc-39
OS Linux x64 5.4.119-19.0009.28
CPUs Intel(R) Xeon(R) Platinum 8480+ (200 x 0)
Memory (System) 1877.99GB (1710.75GB free)
VM 0%

A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
jchc7451:31067544
showvideoc:31016891
chatpanelc:31048052
dsvsc021:30996838
f3je6385:31013174
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
pythonprt:31056678
dwnewjupyter:31046869
2f103344:31067618
26j00206:31048877

simone-viozzi commented 3 weeks ago

Same issue here, is there a workaround?

BrunoCoimbra commented 3 weeks ago

Is it the same as #357?

devymex commented 3 weeks ago

Is it the same as #357?

Yes, but it looks like a bug of vscode rather than vscode-python-debugger or debugpy: https://github.com/microsoft/vscode/issues/214433

paulacamargo25 commented 2 weeks ago

Issue solved in https://github.com/microsoft/vscode/issues/214433.