public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/python+doco/NEWS] Add gdb.Type.name attribute.
Date: Mon, 23 Dec 2013 03:54:00 -0000	[thread overview]
Message-ID: <838uvc8bo4.fsf@gnu.org> (raw)
In-Reply-To: <1387769845-28452-1-git-send-email-brobecker@adacore.com>

> From: Joel Brobecker <brobecker@adacore.com>
> Date: Mon, 23 Dec 2013 07:37:25 +0400
> 
> Consider the following declarations:
> 
>     typedef long our_time_t;
>     our_time_t current_time = 1384395743;
> 
> The purpose of this patch is to allow the use of a pretty-printer
> for variables of type our_time_t.  Normally, pretty-printing sniffers
> use the tag name in order to determine which, if any, pretty-printer
> should be used. But in the case above, the tag name is not set, since
> it does not apply to integral types.
> 
> This patch extends the gdb.Type list of attributes to also include
> the name of the type, thus allowing the sniffer to match against
> that name. With that change, I was able to write a pretty-printer
> which displays our variable as follow:
> 
>     (gdb) print current_time
>     $1 = Thu Nov 14 02:22:23 2013 (1384395743)
> 
> gdb/ChangeLog:
> 
>         * python/py-type.c (typy_get_name): New function.
>         (type_object_getset): Add entry for attribute "name".
>         * NEWS: Add entry mentioning this new attribute.
> 
> gdb/doc/ChangeLog:
> 
>         * gdb.texinfo (Types In Python): Document new attribute Types.name.
> 
> gdb/testsuite/gdb.python:
> 
>         * py-pp-integral.c: New file.
>         * py-pp-integral.py: New file.
>         * py-pp-integral.exp: New file.
> 
> Tested on x86_64-linux. OK to commit?

OK for the documentation parts.

Thanks.

  reply	other threads:[~2013-12-23  3:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-23  3:37 Joel Brobecker
2013-12-23  3:54 ` Eli Zaretskii [this message]
2014-01-06 21:44 ` Tom Tromey
2014-01-07  3:14   ` Joel Brobecker
2014-01-09 18:55 ` Tom Tromey
2014-01-10  4:02   ` Joel Brobecker

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=838uvc8bo4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).