Debugging Step into my code and other actions Intermittent / inconsistent. Follow
Answered
Community Edition 2017.1
- Windows 10
- VMware Virtual Machine
- Breakpoints work as expected
- Some code I can step through some I cannot.
- I cannot find a pattern regarding types of code, structure etc.where it works/ where it doesn't.
- The same file on another computer debugging works fine.
Please sign in to leave a comment.
Hi! Please, provide a code sample for reproducing the issue.
Set break points at 10 and 15.
Console window displays:
0.2198039027185569 -1.8198039027185569
Process finished with exit code 0
I expected debugger to step to line 11 and display the value of disc. I also expected to be able to then step through lines 11, 12 etc. and see the values of root1 and root2.
At step 8 if I click Step Into instead of Step into my code, I can step through 11-13.
import math

class Solver:
def demo(self):
a = int(input("a "))
b = int(input("b "))
c = int(input("c "))
d = b ** 2 - 4 * a * c
disc = math.sqrt(d)
root1 = (-b + disc) / (2 * a)
root2 = (-b - disc) / (2 * a)
print(root1, root2)
Solver().demo()
I am new. My expectations are based on other debuggers. So, I may have the wrong expectations. Maybe I just don't understand when to use step into and when to use step into my code.
@C9tyndall Yes, after "Step into my code" it should go to line 11, you're right. "Step into my code" works similar to "Step into", but it skips library files and stops inside user's code.
So, it looks like a bug, but, unfortunately, I can't reproduce it. What operation system and Python interpreter do you use?
OS = Microsoft Windows Version 1607 (OS Build 14393.1066)
Python 3.6.1
PyCharm 2017.1.1
Build #PY-171.4163.6, built on April 11, 2017
Licensed to PyCharm Evaluator
Expiration date: May 16, 2017
JRE: 1.8.0_112-release-736-b16 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0