4

I have a global variable (I know) that is being changed from a good value to a bad value somewhere. I don't know where, and I'd like to find out where. I would like my debugger (Eclipse/PyDev) to break any time any code writes to this global variable, something akin to hardware breakpoints in OllyDBG.

One trick I've found that sometimes works in this situation is to refactor the variable as a property and then set a breakpoint in that property's setter: any access to the variable goes through the setter and I get what I want from the debugger. This isn't working in this case.

Ideas?

1

1 Answer 1

2

Unfortunately, PyDev does not have such a feature (and after thinking a bit on how would that be implemented, I couldn't come up with a way to implement that) -- your solution on changing it for a property is the one I use when I need that feature (and it won't work for a global variable as you said... in this case, instead of having a global variable I usually have a 'holder' instance that contains the variables, in which case it's still possible to create a property for it to work).

@slowdog: that was a different question related to watchpoints (which actually works on PyDev now).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.