API confusion re: watchpoints

Christian Convey <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAPfS4Zx+qEy07R7-tgtn+baEan6nQW4vuvJ2XMjk312imuZHRg@mail.gmail.com>
I'm new to gdb's Python API, and I was hoping someone could clarify
watchpoints for me...

Question 1:
I'm defining my own subclass of 'gdb.Breakpoint' (initialized to be a
watchpoint).  I'd like to perform some processing every time its
expression becomes invalid.  I.e., every time gdb would print the
message "Watchpoint n deleted because the program has left the block
in which its expression is valid."

Does the Python API give me a way to run code at those times?

Question 2:
The documentation for 'gdb.Breakpoint.delete()' warns that once that
method is called, it's not valid to call any other method on that
object.  My question is: will gdb ever call that method itself, or
will that method only get called if some user/script explicitly does
it explicitly?

My concern is that if gdb automatically deletes its internal version
of a watchpoint object when the watched expression becomes invalid, I
might find the corresponding gdb.Breakpoint object becoming unusable
without warning.

Thanks,
Christian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.