This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Python Finish Breakpoints
- From: Tom Tromey <tromey at redhat dot com>
- To: Kevin Pouget <kevin dot pouget at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 27 May 2011 14:30:25 -0600
- Subject: Re: [RFC] Python Finish Breakpoints
- References: <BANLkTim+YH64zkWvdz2_kVUUj=AJ7v4LKw@mail.gmail.com> <BANLkTi=Eu-5B4YyhP2rGdQXgXbBN-EmLKA@mail.gmail.com> <BANLkTikt2hEUcXkGVH44NaUcwiF1SGdMaw@mail.gmail.com> <BANLkTi=UpgogckTD5MZsW+PC5d2F8X-+jA@mail.gmail.com> <BANLkTi==bj50mZgFKq_qA-+3-2CQA3tBVw@mail.gmail.com> <BANLkTimmYEmvKT_984jYEVZnA5RGFpEgNw@mail.gmail.com> <m34o4qd5lh.fsf@fleche.redhat.com> <BANLkTinZ3DSVPRvSiFydCuYs71-DM5-aOg@mail.gmail.com>
>>>>> "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