This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] bound_registers.py: Add support for Python 3
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Jonah Graham <jonah at kichwacoders dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 22 Mar 2017 09:16:20 +0000
- Subject: Re: [PATCH] bound_registers.py: Add support for Python 3
- Authentication-results: sourceware.org; auth=none
- References: <20161120204526.7203-1-jonah@kichwacoders.com> <b5995c57-c724-3023-8814-b633d9d912e7@codesourcery.com> <CAPmGMvhcF2RyzyTtRbSsvcwwhcVCiFzi0kQu3qKx+Kb94++OqA@mail.gmail.com> <9c9ac6f4-1f6c-3ebe-b23d-3611f4f52192@codesourcery.com> <CAPmGMvid2z7rShFCTz8nHPrEJCAFXrfbHS+JTv4ATg8uNEoAPg@mail.gmail.com> <CAPmGMvjAAz8TeoiDJ5Fx2Cq8hyG8A+5zdWDYMprrbzQct=H1aw@mail.gmail.com> <3d3a1226-dbb2-04ef-c922-3462e6f318b3@codesourcery.com> <CAPmGMvgg0Kko+M7ki7QRDOTQAkj34QHr7PkgmOmkjauvp8r1YQ@mail.gmail.com> <cfe9a625-551b-beba-5a77-96d21a84c010@redhat.com>
On Fri, Mar 17, 2017 at 3:00 PM, Pedro Alves <palves@redhat.com> wrote:
> diff --git a/gdb/python/lib/gdb/printer/bound_registers.py b/gdb/python/lib/gdb/printer/bound_registers.py
> index b315690..104ea7f 100644
> --- a/gdb/python/lib/gdb/printer/bound_registers.py
> +++ b/gdb/python/lib/gdb/printer/bound_registers.py
> @@ -16,6 +16,11 @@
>
> import gdb.printing
>
> +if sys.version_info[0] > 2:
> + # Python 3 removed basestring and long
> + basestring = str
> + long = int
> +
This change causes some fails in gdb.python/py-pp-maint.exp,
disable pretty-printer^M
6 printers disabled^M
0 of 6 printers enabled^M
(gdb) FAIL: gdb.python/py-pp-maint.exp: disable pretty-printer
looks the number of pretty-printer is changed. Without this patch,
there are 7 pretty-printers,
info pretty-printer^M
global pretty-printers:^M
builtin^M
mpx_bound128^M
lookup_function_lookup_test^M
pp-test^M
enum flag_enum^M
s^M
ss^M
struct s^M
struct ss^M
(gdb) PASS: gdb.python/py-pp-maint.exp: info pretty-printer
but with this patch applied, it becomes 6, mpx_bound128 is
disappeared.
info pretty-printer^M
global pretty-printers:^M
builtin^M
lookup_function_lookup_test^M
pp-test^M
enum flag_enum^M
s^M
ss^M
struct s^M
struct ss^M
(gdb) PASS: gdb.python/py-pp-maint.exp: info pretty-printer
I'll look into this problem further.
--
Yao (齐尧)