0.3.x change breakpoint behaviour

Oct 21, 2015 at 9:53 AM
Edited Oct 21, 2015 at 9:55 AM
Hi All!

We have some bug with conditional breakpoints.

See:
http://pykd.codeplex.com/workitem/13750
http://pykd.codeplex.com/workitem/13748

The main problem the time of live of the python object is not equal to the time of live of breakpoints in the Debug Engine.

There is a strong way:
Python script should get a strong reference to breakpoint object. But it is not convenient to use with unconditional breakpoints especially with REPL. Also some functions return breakpoint object ( for example, getBp ) "for information" and I'm confused what we should do with different reference to the same breakpoint objects.

So, I'm going to offer a compromise:
breakpoints objects will have weak or strong reference depend on case of use:
1) setBp without callback return weak reference.
def set(offset):
   setBp(offset) # we don't need to hold refernce

def del(bp)
   bp.remove()  # breakpoint should be removed explicitly
2) setBp with callback:
setBp(offset, cb) # wrong!  breakpoint will removed when reference is gone
bp = setBp(offset, cb)  #OK, but bp should be hold
3) getBp always return weak reference
Oct 21, 2015 at 10:40 AM
Edited Oct 21, 2015 at 10:42 AM
I think:
  • setBp always return strong reference (remove break point on destroy returned object)
  • getBp always return weak reference