Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Add $_as_string convenience function
Date: Fri, 04 Mar 2016 23:07:00 -0000	[thread overview]
Message-ID: <20160304230722.GB4291@adacore.com> (raw)
In-Reply-To: <1457124218-22342-1-git-send-email-simon.marchi@polymtl.ca>

> 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.

Neat. I think this deserves a NEWS entry!


  reply	other threads:[~2016-03-04 23:07 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 [this message]
2016-03-07 14:54   ` Simon Marchi
2016-03-07 16:18     ` Eli Zaretskii
2016-03-10 20:19 ` Pedro Alves
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=20160304230722.GB4291@adacore.com \
    --to=brobecker@adacore.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