This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

API confusion re: watchpoints


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]