PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

native/python debugger cannot find python source code

Open vsfeedback opened this issue 2 years ago • 3 comments

This issue has been moved from a ticket on Developer Community.


I´m trying to debug python code being called from native code. At first the native/python debugger was not in the list of available debuggers of the native project, description of the (old) issue and workaround can be found here: https://github.com/Microsoft/PTVS/issues/6712?ref=pythonrepo.com With the workaround applied I can now start the native/python debugger and debug the native code. I cannot debug the python code though, instead the "source not found" window is being displayed. When I click on "Browse and find *.py..." it displays "Source search information" saying the source HAS been found and the debugger will use it - but it doesn´t switch to the code:

grafik.png

Visual Studio Version: 17.4.1 (up to date)


Original Comments

Feedback Bot on 11/21/2022, 05:26 PM:

(private comment, text removed)


Original Solutions

(no solutions)

vsfeedback avatar Nov 30 '22 16:11 vsfeedback

What happens if you just open the file directly via File -> Open?

int19h avatar Dec 05 '22 21:12 int19h

The file opens as it should. No debugging possible though.

Some more details: The call path is native code -> python -> native code. The "Source not found" window appears when I place a breakpoint in the native code called from python, then in the call stack window click on the python file.

I have now tried to debug step into (F11) the python code from native. Instead of stepping into the python code though it steps over. After the first time I have placed a breakpoint in the native code being called from python the behaviour is slightly different: When I try to step into the python code the next time I get a message "Unable to step. An operation is not legal in the current state." The only way to continue debugging then is debug continue (F5), while both step into and step over (F10/F11) lead to this error message.

watermain avatar Dec 06 '22 07:12 watermain

Potentially related to https://github.com/microsoft/PTVS/issues/6900

cwebster-99 avatar Aug 14 '24 21:08 cwebster-99