Ask Your Question
1

Debug break on variable change?

asked 2019-06-01 06:35:47 -0500

JeffH gravatar image

updated 2019-06-04 07:33:20 -0500

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-06-03 06:56:52 -0500

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.

edit flag offensive delete link more

Comments

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

kdpainter gravatar imagekdpainter ( 2019-06-03 19:27:09 -0500 )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 gravatar imageWingware Support ( 2019-06-04 07:37:29 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-06-01 06:35:47 -0500

Seen: 553 times

Last updated: Jun 03