This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] bound_registers.py: Add support for Python 3


Hi GDB devs,

This patch fixes
https://sourceware.org/bugzilla/show_bug.cgi?id=19637. This is my
first patch to GDB, I hope it falls within the "Small changes can be
accepted without a copyright assignment form on file." from the
CONTRIBUTING file as the new code in this file was copied from
printing.py as recommended in the bug report. In case it doesn't, and
to cover future contributions, I have started the copyright assignment
process.

Thank you,
Jonah
~~~
Jonah Graham
Kichwa Coders Ltd.
www.kichwacoders.com


On 20 November 2016 at 20:45, Jonah Graham <jonah@kichwacoders.com> wrote:
> gdb/Changelog:
>
>         * python/lib/gdb/printer/bound_registers.py: Add support
>         for Python 3.
> ---
>  gdb/ChangeLog                                 | 5 +++++
>  gdb/python/lib/gdb/printer/bound_registers.py | 5 +++++
>  2 files changed, 10 insertions(+)
>
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 3797e8b..1923888 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,8 @@
> +2016-11-20  Jonah Graham  <jonah@kichwacoders.com>
> +
> +       * python/lib/gdb/printer/bound_registers.py: Add support
> +       for Python 3.
> +
>  2016-11-19  Joel Brobecker  <brobecker@adacore.com>
>
>         * contrib/ari/gdb_ari.sh: Add detection of printf_vma and
> diff --git a/gdb/python/lib/gdb/printer/bound_registers.py b/gdb/python/lib/gdb/printer/bound_registers.py
> index 9ff94aa..e91cc19 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
> +
>  class MpxBound128Printer:
>      """Adds size field to a mpx __gdb_builtin_type_bound128 type."""
>
> --
> 2.10.1
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]