Debugger step over works differently in 2016.2

Answered

I had 2016.1.2, updated to 2014.1.4 then to 2014.2.

Somewhere along the way my debugger started working slightly differently from previous versions. 

Say I have the following code with a break point on line 9 and start stepping over (F8) the code. Once I get to line 12, I expect the step to continue in foo() at line 4 on to line 5, 6, then to 15,16.

Unfortunately this is not the case anymore.  After line 12, the step will go to line 4, then continue on with the rest of the program.  Is there some setting that controls how this works?

0
4 comments
Official comment

Yes, I've spotted the problem. Please, go to Python Debugger settings (https://www.jetbrains.com/help/pycharm/2016.2/python-debugger.html) and uncheck the option "Collect run-time types information for code insight". Does it help?

It's a bug and I've created the issue about it in our tracker: https://youtrack.jetbrains.com/issue/PY-20335

Hi Marcel Wilson! Unfortunately, I can't reproduce the bug. For me the debugger after line 12 goes to line 5, 6 and then to line 16.
Please, set environment variable PYCHARM_DEBUG=True to your run configuration and provide console output for your debug session. 

1
C:\Python27\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 2016.2\helpers\pydev\pydevd.py" --multiproc --save-signatures --qt-support --client 127.0.0.1 --port 61657 --file D:/wx/qasandbox/learning/test2.py
PYDEVD_FILTER_LIBRARIES False

Started in multiproc mode

('Connecting to ', '127.0.0.1', ':', '61657')
('Connected.',)
debugger: received >>99    -1    61658
<<
Received command: ??? 99    -1    61658

Received port 61658

pydev debugger: process 10988 is connecting

Connected to pydev debugger (build 162.1237.1)
('Connecting to ', '127.0.0.1', ':', '61658')
('Connected.',)
debugger: received >>501    1    0.1    WIN
<<
Received command: CMD_VERSION 501    1    0.1    WIN

sending cmd -->          CMD_VERSION 501    1    @@BUILD_NUMBER@@
debugger: received >>111    3    python-line    d:/wx/qasandbox/learning/test2.py    9    bar    None    None
<<
Received command: CMD_SET_BREAK 111    3    python-line    d:/wx/qasandbox/learning/test2.py    9    bar    None    None

Added breakpoint:d:\wx\qasandbox\learning\test2.py - line:9 - func_name:bar

debugger: received >>111    5    python-line    d:/wx/qasandbox/learning/playingwithlibconf.py    37    None    None    None
146    7    SHOW_RETURN_VALUES    1
101    9    
<<
Received command: CMD_SET_BREAK 111    5    python-line    d:/wx/qasandbox/learning/playingwithlibconf.py    37    None    None    None

Added breakpoint:d:\wx\qasandbox\learning\playingwithlibconf.py - line:37 - func_name:None

Received command: CMD_SHOW_RETURN_VALUES 146    7    SHOW_RETURN_VALUES    1

Show return values: True

Received command: CMD_RUN 101    9    

IDE_PROJECT_ROOTS ['D:/wx']

LIBRARY_ROOTS ['C:/Python27/Lib/site-packages/OWSLib-0.7.2-py2.7.egg', 'C:/Python27/Lib/site-packages/python_dateutil-2.1-py2.7.egg', 'C:/Python27/Lib/site-packages/SQLAlchemy-0.8.1-py2.7-win32.egg!/', 'C:/Python27/Lib/site-packages/grequests-0.2.0-py2.7.egg', 'C:/Python27/Lib/site-packages/amqp-1.4.4-py2.7.egg', 'D:/wx/wxcommon', 'D:/wx/wxauxiliary', 'D:/wx/gis_web_services/automation_tests', 'D:/wx/gis_web_services/shared', 'D:/wx/rest/test', 'D:/wx/MRMSDailyPrecip', 'C:/Python27/DLLs', 'C:/Python27/Lib', 'C:/Python27/Lib/lib-tk', 'C:/Python27', 'C:/Python27/Lib/site-packages', 'C:/Python27/Lib/site-packages/PIL', 'C:/Python27/Lib/site-packages/win32', 'C:/Python27/Lib/site-packages/win32/lib', 'C:/Python27/Lib/site-packages/pythonwin', 'C:/Python27/Lib/site-packages/wx-2.8-msw-ansi', 'C:/Users/marcel.wilson/.PyCharm2016.2/system/python_stubs/-762174762', 'C:/Program Files (x86)/JetBrains/PyCharm 2016.2/helpers/python-skeletons', 'D:/wx/rest/test']

sending cmd --> CMD_SIGNATURE_CALL_TRACE 130    2    <xml><call_signature file="D:/wx/qasandbox/learning/test2.py" name="&lt;module&gt;"></call_signature></xml>
sending cmd --> CMD_SIGNATURE_CALL_TRACE 130    4    <xml><call_signature file="D:/wx/qasandbox/learning/test2.py" name="foo"></call_signature></xml>
sending cmd --> CMD_SIGNATURE_CALL_TRACE 130    6    <xml><call_signature file="D:/wx/qasandbox/learning/test2.py" name="bar"></call_signature></xml>
sending cmd -->    CMD_THREAD_CREATE 103    8    <xml><thread name="MainThread" id="pid_10988_id_39006416" /></xml>
sending cmd -->   CMD_THREAD_SUSPEND 105    10    <xml><thread id="pid_10988_id_39006416" stop_reason="111" message=""><frame id="41388784" name="bar" file="d:\wx\qasandbox\learning\test2.py" line="9"></frame><frame id="41387752" name="foo" file="d:\wx\qasandbox\learning\test2.py" line="4"></frame><frame id="46554448" name="&lt;module&gt;" file="d:\wx\qasandbox\learning\test2.py" line="15"></frame><frame id="41022336" name="run" file="c:\program files (x86)\jetbrains\pycharm 2016.2\helpers\pydev\pydevd.py" line="940"></frame><frame id="35099040" name="&lt;module&gt;" file="c:\program files (x86)\jetbrains\pycharm 2016.2\helpers\pydev\pydevd.py" line="1556"></frame></thread></xml>
debugger: received >>114    11    pid_10988_id_39006416    41388784    FRAME
<<
Received command: CMD_GET_FRAME 114    11    pid_10988_id_39006416    41388784    FRAME

debugger: received >>114    13    pid_10988_id_39006416    41388784    FRAME
<<
Received command: CMD_GET_FRAME 114    13    pid_10988_id_39006416    41388784    FRAME

('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalGetFrame instance at 0x02777300>')
('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalGetFrame instance at 0x02BEC990>')
sending cmd -->        CMD_GET_FRAME 114    11    <xml></xml>
sending cmd -->        CMD_GET_FRAME 114    13    <xml></xml>
debugger: received >>108    15    pid_10988_id_39006416
<<
Received command: CMD_STEP_OVER 108    15    pid_10988_id_39006416

('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalStepThread instance at 0x027773F0>')
sending cmd -->       CMD_THREAD_RUN 106    12    pid_10988_id_39006416    108
sending cmd -->   CMD_THREAD_SUSPEND 105    14    <xml><thread id="pid_10988_id_39006416" stop_reason="108" message=""><frame id="41388784" name="bar" file="d:\wx\qasandbox\learning\test2.py" line="10"></frame><frame id="41387752" name="foo" file="d:\wx\qasandbox\learning\test2.py" line="4"></frame><frame id="46554448" name="&lt;module&gt;" file="d:\wx\qasandbox\learning\test2.py" line="15"></frame><frame id="41022336" name="run" file="c:\program files (x86)\jetbrains\pycharm 2016.2\helpers\pydev\pydevd.py" line="940"></frame><frame id="35099040" name="&lt;module&gt;" file="c:\program files (x86)\jetbrains\pycharm 2016.2\helpers\pydev\pydevd.py" line="1556"></frame></thread></xml>
debugger: received >>114    17    pid_10988_id_39006416    41388784    FRAME
<<
Received command: CMD_GET_FRAME 114    17    pid_10988_id_39006416    41388784    FRAME

debugger: received >>114    19    pid_10988_id_39006416    41388784    FRAME
<<
Received command: CMD_GET_FRAME 114    19    pid_10988_id_39006416    41388784    FRAME

('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalGetFrame instance at 0x02777300>')
('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalGetFrame instance at 0x027773F0>')
sending cmd -->        CMD_GET_FRAME 114    17    <xml><var name="var" type="str"  qualifier="__builtin__"  value="str: " /> </xml>
sending cmd -->        CMD_GET_FRAME 114    19    <xml><var name="var" type="str"  qualifier="__builtin__"  value="str: " /> </xml>
debugger: received >>108    21    pid_10988_id_39006416
<<
Received command: CMD_STEP_OVER 108    21    pid_10988_id_39006416

('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalStepThread instance at 0x027773F0>')
sending cmd -->       CMD_THREAD_RUN 106    16    pid_10988_id_39006416    108
sending cmd -->   CMD_THREAD_SUSPEND 105    18    <xml><thread id="pid_10988_id_39006416" stop_reason="108" message=""><frame id="41388784" name="bar" file="d:\wx\qasandbox\learning\test2.py" line="11"></frame><frame id="41387752" name="foo" file="d:\wx\qasandbox\learning\test2.py" line="4"></frame><frame id="46554448" name="&lt;module&gt;" file="d:\wx\qasandbox\learning\test2.py" line="15"></frame><frame id="41022336" name="run" file="c:\program files (x86)\jetbrains\pycharm 2016.2\helpers\pydev\pydevd.py" line="940"></frame><frame id="35099040" name="&lt;module&gt;" file="c:\program files (x86)\jetbrains\pycharm 2016.2\helpers\pydev\pydevd.py" line="1556"></frame></thread></xml>
debugger: received >>114    23    pid_10988_id_39006416    41388784    FRAME
<<
Received command: CMD_GET_FRAME 114    23    pid_10988_id_39006416    41388784    FRAME

debugger: received >>114    25    pid_10988_id_39006416    41388784    FRAME
<<
Received command: CMD_GET_FRAME 114    25    pid_10988_id_39006416    41388784    FRAME

('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalGetFrame instance at 0x02BECD28>')
('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalGetFrame instance at 0x02777300>')
sending cmd -->        CMD_GET_FRAME 114    23    <xml><var name="var" type="str"  qualifier="__builtin__"  value="str: " /> </xml>
sending cmd -->        CMD_GET_FRAME 114    25    <xml><var name="var" type="str"  qualifier="__builtin__"  value="str: " /> </xml>
debugger: received >>108    27    pid_10988_id_39006416
<<
Received command: CMD_STEP_OVER 108    27    pid_10988_id_39006416

('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalStepThread instance at 0x027773F0>')
sending cmd -->       CMD_THREAD_RUN 106    20    pid_10988_id_39006416    108
sending cmd -->   CMD_THREAD_SUSPEND 105    22    <xml><thread id="pid_10988_id_39006416" stop_reason="108" message=""><frame id="41388784" name="bar" file="d:\wx\qasandbox\learning\test2.py" line="12"></frame><frame id="41387752" name="foo" file="d:\wx\qasandbox\learning\test2.py" line="4"></frame><frame id="46554448" name="&lt;module&gt;" file="d:\wx\qasandbox\learning\test2.py" line="15"></frame><frame id="41022336" name="run" file="c:\program files (x86)\jetbrains\pycharm 2016.2\helpers\pydev\pydevd.py" line="940"></frame><frame id="35099040" name="&lt;module&gt;" file="c:\program files (x86)\jetbrains\pycharm 2016.2\helpers\pydev\pydevd.py" line="1556"></frame></thread></xml>
debugger: received >>114    29    pid_10988_id_39006416    41388784    FRAME
<<
Received command: CMD_GET_FRAME 114    29    pid_10988_id_39006416    41388784    FRAME

debugger: received >>114    31    pid_10988_id_39006416    41388784    FRAME
<<
Received command: CMD_GET_FRAME 114    31    pid_10988_id_39006416    41388784    FRAME

('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalGetFrame instance at 0x02BDB288>')
('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalGetFrame instance at 0x02BECD28>')
sending cmd -->        CMD_GET_FRAME 114    29    <xml><var name="var" type="str"  qualifier="__builtin__"  value="str: something" /> </xml>
sending cmd -->        CMD_GET_FRAME 114    31    <xml><var name="var" type="str"  qualifier="__builtin__"  value="str: something" /> </xml>
debugger: received >>108    33    pid_10988_id_39006416
<<
Received command: CMD_STEP_OVER 108    33    pid_10988_id_39006416

('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalStepThread instance at 0x02BECD28>')
sending cmd -->       CMD_THREAD_RUN 106    24    pid_10988_id_39006416    108
sending cmd --> CMD_SIGNATURE_CALL_TRACE 130    26    <xml><call_signature file="D:/wx/qasandbox/learning/test2.py" name="bar"><return type="str"></return></call_signature></xml>
sending cmd -->   CMD_THREAD_SUSPEND 105    28    <xml><thread id="pid_10988_id_39006416" stop_reason="108" message=""><frame id="41387752" name="foo" file="d:\wx\qasandbox\learning\test2.py" line="4"></frame><frame id="46554448" name="&lt;module&gt;" file="d:\wx\qasandbox\learning\test2.py" line="15"></frame><frame id="41022336" name="run" file="c:\program files (x86)\jetbrains\pycharm 2016.2\helpers\pydev\pydevd.py" line="940"></frame><frame id="35099040" name="&lt;module&gt;" file="c:\program files (x86)\jetbrains\pycharm 2016.2\helpers\pydev\pydevd.py" line="1556"></frame></thread></xml>
debugger: received >>114    35    pid_10988_id_39006416    41387752    FRAME
<<
Received command: CMD_GET_FRAME 114    35    pid_10988_id_39006416    41387752    FRAME

debugger: received >>114    37    pid_10988_id_39006416    41387752    FRAME
<<
Received command: CMD_GET_FRAME 114    37    pid_10988_id_39006416    41387752    FRAME

('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalGetFrame instance at 0x02777300>')
('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalGetFrame instance at 0x02BECD28>')
sending cmd -->        CMD_GET_FRAME 114    35    <xml><var name="bar" type="str"  qualifier="__builtin__"  value="str: something" isRetVal="True" /> </xml>
sending cmd -->        CMD_GET_FRAME 114    37    <xml><var name="bar" type="str"  qualifier="__builtin__"  value="str: something" isRetVal="True" /> </xml>
debugger: received >>108    39    pid_10988_id_39006416
<<
Received command: CMD_STEP_OVER 108    39    pid_10988_id_39006416

('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalStepThread instance at 0x02BECCD8>')
something
finished

Process finished with exit code 0
0

uncheck the option "Collect run-time types information for code insight". Does it help?

I'll be darned, that was it! 

I want to make sure I understand the ramifications of this.  That setting is what allows me to see type hinting automatically in the editor if I haven't used restructured text in the docstring yet, right?  (i.e. when I use ctrl+q to see quick-documentation)   So using docstring type hinting will still work, I just won't get the automatically determined hints at run-time.   I think I can live with for now.

Thanks for the help!

0

Please sign in to leave a comment.