This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix python compatibility with old gdb versions
- From: Orgad Shaneh <orgads at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Sun, 11 Jun 2017 16:55:23 +0300
- Subject: Re: [PATCH] Fix python compatibility with old gdb versions
- Authentication-results: sourceware.org; auth=none
- References: <CAGHpTBLpHpuQNhzc031L+Zy4-tExP5S3bSJfra3iH6E=GYfmAQ@mail.gmail.com>
On Wed, Mar 8, 2017 at 10:23 AM, Orgad Shaneh <orgads@gmail.com> wrote:
>
> Type.name was introduced in GDB 7.9.
> ---
> gdb/python/lib/gdb/printing.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gdb/python/lib/gdb/printing.py b/gdb/python/lib/gdb/printing.py
> index 181701c719..106da4ac8b 100644
> --- a/gdb/python/lib/gdb/printing.py
> +++ b/gdb/python/lib/gdb/printing.py
> @@ -205,7 +205,7 @@ class RegexpCollectionPrettyPrinter(PrettyPrinter):
>
> # Get the type name.
> typename = gdb.types.get_basic_type(val.type).tag
> - if not typename:
> + if not typename and hasattr(val.type, "name"):
> typename = val.type.name
> if not typename:
> return None
> --
> 2.12.0.windows.1
ping?
- Orgad