PyCharm Pro 2024.1.1 – Not stopping on all breakpoints

  Kiến thức lập trình

I am using Pycharm Professional Ver 2024.1.1, in Windows 11, and it is not stopping on breakpoints defined in called/sub functions when ‘stepping over’ with F8. To recreate this simply use the sample code created with a new PyCharm project:

1    def print_hi(name):
2        print(f'Hi, {name}')  # Press Ctrl+F8 to toggle the breakpoint.
3    
4    if __name__ == '__main__':
5        print_hi('PyCharm')

Place a break point on the print (Line 2) statement and the print_hi (Line 5) command.

If I hit F9 a few times it will stop on both break points.

If I hit F9, wait for PyCharm debugger to stop on the line 5 and then hit F8, it will not stop on the break point that is set on line 2. This kinda makes sense as I am hitting F8 to ‘step over’ the function but I seem to recall that this was not the behavior in previous versions. Also F9 is also a step over function so why doesn’t that key bypass the breakpoints?

Is there anyway to tell PyCharm to stop on all break points regardless of the step over -vs- step into key that I press?

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT