First time here? Check out the FAQ!
1

Debug break on variable change?

I see how to set a conditional breakpoint on a particular line of code, but is there a way to set a breakpoint whenever a variable changes (or when it equals a particular value) anywhere in the code?

JeffH's avatar
31
JeffH
asked 2019-06-01 06:35:47 -0600
Wingware Support's avatar
4k
Wingware Support
updated 2019-06-04 07:33:20 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

Unfortunately the debugger does not support stopping when a variable changes. You can sometimes workaround this by using a property and setting a breakpoint in the set method.

Wingware Support's avatar
4k
Wingware Support
answered 2019-06-03 06:56:52 -0600
edit flag offensive 0 remove flag delete link

Comments

I wonder if you guys could implement that functionality automatically? That would be a cool feature.

kdpainter's avatar kdpainter (2019-06-03 19:27:09 -0600) edit

It is on our list of possible improvements. At one point (long ago now) we contributed a patch to Python to make it easier. I think it never made it into the language, but there may be comparable changes in recent Python versions. It's not really feasible to do in a general way without some language support since checking for a value change with each byte code would add extraordinary overhead.

Wingware Support's avatar Wingware Support (2019-06-04 07:37:29 -0600) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer