Re: [RFC] Python Finish Breakpoints

Tom Tromey
2011-05-27T20:30:44Z

>>>>> "Kevin" == Kevin Pouget <kevin.pouget@gmail.com> writes:

Kevin> you're right; I chose the second way,

Kevin> breakpoint.h:
Kevin> enum py_bp_type
Kevin> {
Kevin> py_bp_none, /* No Python object. */

I don't think this one is needed.

Kevin> py_bp_standard, /* Ordinary breakpoint object. */
Kevin> py_bp_finish /* FinishBreakpoint object. */

These should be uppercase, but it seems to me that if there are just 2
states you might as well use an ordinary boolean(-ish) flag.

Kevin> as per your two comments, I now only store the `struct type' of the
Kevin> function and the return value,

You need to store a gdb.Type wrapper.
A 'struct type' can also be invalidated when an objfile is destroyed.

Kevin> diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint-cc.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint-cc.exp

Tom> Funny file name.

Kevin> funny but correct, or too funny? ;)

It is more usual in the gdb test suite to give the .cc and .exp files
the same base name.

Kevin> I'll work on the tests for the next version of the patch ("return"
Kevin> should already be covered)

I will wait for this to do more review.

Kevin> @defivar FinishBreakpoint out_of_scope_notif
Kevin> This attribute will be @code{True} until the @code{out_of_scope} method has
Kevin> been called and @code{False} afterwards. This attribute is writeable, so out
Kevin> of scope notifications can be re-enabled.
Kevin> @end defivar

I still don't really understand under what circumstances it is useful
for a program to set this attribute.

Kevin> - avoid calling `out_of_scope' every normal_stop when the breakpoint
Kevin> is not anymore in the callstack

I think it would be ok to just leave this up to the subclass to handle.

Kevin> - allow the script to re-activate notification when it wants to
Kevin> 're-use' the FinishBreakpoint (instead of deleting it / creating a new
Kevin> one)

I am not sure when this makes sense.

Tom