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: Thu, 20 Oct 2011 14:41:01 -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> <m3vcwvubry.fsf@fleche.redhat.com> <BANLkTinBg76_-9i5n=VA2NXp+ZF978J=ig@mail.gmail.com>
>>>>> "Kevin" == Kevin Pouget <kevin.pouget@gmail.com> writes:
Tom> You need to store a gdb.Type wrapper.
Tom> A 'struct type' can also be invalidated when an objfile is destroyed.
Kevin> I wouldn't mind, but I can't see how gdb.Type ensures validity, as far
Kevin> as I've seen, there is no "is_valid" method and I can't and no further
Kevin> verification during the Python -> C translation:
When an objfile is destroyed, py-type.c:save_objfile_types is called.
This makes a copy of the struct type underlying any relevant Type object.
[ out_of_scope_notif ]
Kevin> - avoid calling `out_of_scope' every normal_stop when the breakpoint
Kevin> is not anymore in the callstack
It seems to me that manually managing this is not the best we could do.
I was re-reading the code and I realized that this isn't actually
working the way I had remembered it working:
+A @fdb{finish breakpoint} is a breakpoint set at the return address of
+a frame, based on the "finish command. @code{gdb.FinishBreakpoint} extends
+@code{gdb.Breakpoint}
This approach is fine; but once a frame is gone, it is gone -- we should
just destroy the breakpoint at that point. Maybe this would make the
internal logic simpler as well.
(I had been laboring under the misconception that a finish breakpoint
took a linespec and then did the bookkeeping of "note function entry /
set a new breakpoint" -- but actually I like your simpler approach
better, and the latter can be done more easily purely in Python.)
Tom