From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Add $_as_string convenience function
Date: Thu, 10 Mar 2016 20:19:00 -0000 [thread overview]
Message-ID: <56E1D6C6.9010004@redhat.com> (raw)
In-Reply-To: <1457124218-22342-1-git-send-email-simon.marchi@polymtl.ca>
On 03/04/2016 08:43 PM, Simon Marchi wrote:
> This patch is a follow-up to "Add printf format specifier for printing
> enumerator":
>
> https://sourceware.org/ml/gdb-patches/2016-02/msg00144.html
>
> Instead of having a solution specific to the printf command, Pedro
> suggested adding a general purpose function $_as_string() that would
> cover this use case and more.
>
> So, in order to print the textual label of an enum, one can use:
>
> (gdb) printf "Visiting node of type %s\n", $_as_string(node)
> Visiting node of type NODE_INTEGER
>
> gdb/ChangeLog:
>
> * data-directory/Makefile.in (PYTHON_FILE_LIST): Install
> gdb/function/as_string.py.
> * python/lib/gdb/function/as_string.py: New file.
>
> gdb/testsuite/ChangeLog:
>
> * gdb.python/py-as-string.exp: New file.
> * gdb.python/py-as-string.c: New file.
>
> gdb/doc/ChangeLog:
>
> * gdb.texinfo (Convenience Functions): Document $_as_string.
LGTM, thanks for doing this.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2016-03-10 20:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-04 20:43 Simon Marchi
2016-03-04 23:07 ` Joel Brobecker
2016-03-07 14:54 ` Simon Marchi
2016-03-07 16:18 ` Eli Zaretskii
2016-03-10 20:19 ` Pedro Alves [this message]
2016-03-10 22:22 ` Simon Marchi
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=56E1D6C6.9010004@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/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