This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [python] Crash when using generators with Python 2.4
- From: Tom Tromey <tromey at redhat dot com>
- To: ppluzhnikov at google dot com (Paul Pluzhnikov)
- Cc: archer at sourceware dot org, Jeffrey Yasskin <jyasskin at google dot com>
- Date: Fri, 16 Jan 2009 16:10:19 -0700
- Subject: Re: [python] Crash when using generators with Python 2.4
- References: <20090116184744.AEF2C3A6B56@localhost>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Paul" == Paul Pluzhnikov <ppluzhnikov@google.com> writes:
Paul> A. somehow push a "dummy" Python frame before calling next() on
Paul> the iterator returned from children() [I don't know how exactly to
Paul> do that], or
Paul> B. disallow generators as return from children() if GDB was built
Paul> with Python 2.4 [I believe I know how to do that.]
Paul> A) has the advantage that the same pretty printers will work
Paul> regardless of which Python was used; but it is more of a hack.
Paul> Comments?
If making a dummy frame is something supported by the Python C API,
then I would prefer that. Using a generator in a pretty-printer seems
like a fairly reasonable thing for users to do.
BTW, now would be a very good time to implement this. I would like to
start sending more pretty-printing patches upstream as soon as I'm
done with my current patch.
Tom