This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
API confusion re: watchpoints
- From: Christian Convey <christian dot convey at gmail dot com>
- To: gdb at sourceware dot org
- Date: Thu, 28 Jul 2016 13:38:47 -0400
- Subject: API confusion re: watchpoints
- Authentication-results: sourceware.org; auth=none
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