From: "Wiederhake, Tim" <tim.wiederhake@intel.com>
To: Joel Brobecker <brobecker@adacore.com>,
"Jose E. Marchesi" <jose.marchesi@oracle.com>
Cc: Yao Qi <qiyaoltc@gmail.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: MemoryView missing from Python 2.4 and 2.6
Date: Tue, 07 Mar 2017 13:38:00 -0000 [thread overview]
Message-ID: <9676A094AF46E14E8265E7A3F4CCE9AF9428CB@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <20170307002119.ri3xv4cfxfkrb4gm@adacore.com>
Hi Joel!
> It looks like the patch is also removing the feature from users of
> Python 2.7.x, though, is it not?
The patch (see https://sourceware.org/ml/gdb-patches/2017-03/msg00039.html)
does not remove any feature. The patch changes the return type of one function
from "memoryview" to "buffer" for Python 2.7 and below. Both types support the
"in" keyword, indexed access, length etc. and behave very similar. Granted,
memoryview has some additional functions that lets the user inspect the stride
and size of the elements in the buffer, but this is a feature we do not use
here anyway.
I chose 2.7 as a parting point because that is how it is handled in
infpy_read_memory in py-inferior.c. Personally, I would leave it that way
because with "buffer" exposed with Python 2.7 as well as Python 2.6 and below,
I guess it gets more exposure and testing and won't suffer bit-rot as easily.
The patch is tested with Python 2.7 and Python 3.6. I cannot test it with
Python 2.6 but that should not be necessary as these two versions already check
both different return types.
Tim
> -----Original Message-----
> From: Joel Brobecker [mailto:brobecker@adacore.com]
> Sent: Tuesday, March 7, 2017 1:21 AM
> To: Jose E. Marchesi <jose.marchesi@oracle.com>
> Cc: Wiederhake, Tim <tim.wiederhake@intel.com>; Yao Qi
> <qiyaoltc@gmail.com>; gdb-patches@sourceware.org
> Subject: Re: MemoryView missing from Python 2.4 and 2.6
>
> Hello,
>
> > Jose, can you confirm that this patch un-breaks GDB linked with
> > Python 2.6?
> >
> > Yep. This fixes the build with Python 2.6.6.
>
> It looks like the patch is also removing the feature from users of Python 2.7.x,
> though, is it not? Given that this is a new feature, this wouldn't be the end of
> the world, especially since we're so close to branching, so we wouldn't want
> that to be a reason to delay the fix too much longer. However, I think our
> configure script defines HAVE_LIBPYTHON2_7, so perhaps we could either
> use that, or explicitly exclude HAVE_LIBPYTHON2_6, HAVE_LIBPYTHON2_5
> and HAVE_LIBPYTHON2_4 instead of only including it for Python 3.x?
>
> --
> Joel
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2017-03-07 13:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-23 16:48 Jose E. Marchesi
2017-02-23 17:06 ` Jose E. Marchesi
2017-02-23 22:59 ` Yao Qi
2017-02-24 10:37 ` Wiederhake, Tim
2017-02-24 16:06 ` Yao Qi
2017-02-24 16:14 ` Paul.Koning
2017-02-28 10:53 ` Wiederhake, Tim
2017-02-28 12:51 ` Jose E. Marchesi
2017-03-07 0:21 ` Joel Brobecker
2017-03-07 13:38 ` Wiederhake, Tim [this message]
2017-03-07 15:27 ` Joel Brobecker
2017-03-03 10:21 ` Yao Qi
2017-03-06 8:56 ` Wiederhake, Tim
2017-03-07 10:32 ` Yao Qi
2017-03-07 17:18 ` Wiederhake, Tim
2017-03-17 15:59 ` Yao Qi
2017-03-17 16:39 ` Jose E. Marchesi
2017-03-20 9:04 ` Yao Qi
2017-03-20 22:44 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9676A094AF46E14E8265E7A3F4CCE9AF9428CB@irsmsx105.ger.corp.intel.com \
--to=tim.wiederhake@intel.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jose.marchesi@oracle.com \
--cc=qiyaoltc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox