Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop at the line where a variable gets changed

I am trying to track down when a variable gets updated. I have a watcher, but is there any way to set it up so that the execution can be paused when the value is getting updated?

This is called a watchpoint or a data breakpoint.

like image 558
thinkanotherone Avatar asked Sep 21 '14 02:09

thinkanotherone


People also ask

How do you break a variable change in Visual Studio?

Setting a data breakpoint is as easy as right-clicking on the property you're interested in watching inside the watch, autos, or locals window and selecting “Break when value changes” in the context menu. All data breakpoints are displayed in the Breakpoints window.

Which window should you use to cause VBA execution to pause when the value of a variable changes?

You can display the Watch window by choosing Watch Window from the View menu. A Watch is an instruction to VBA to pause code when an expression is True or when the variable being watched changes value.


1 Answers

Currently pycharm does not have a default built-in feature that tracks variable modification in real time. Alternatively you can do this:

  1. run debug
  2. From debugger pane -> Variables, right click the variable you would like to track and and add it to Watches.
  3. In Watches pane, right click the variable and select referring objects.

The feature you are talking about is, I believe, called watchpoint support and according to this article: http://sourceforge.net/blog/watchpoints-in-python/ Eric and PyScriptor has the feature but not pycharm.

like image 123
TastyCatFood Avatar answered Oct 07 '22 03:10

TastyCatFood