Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Add printf format specifier for printing enumerator
Date: Fri, 05 Feb 2016 15:08:00 -0000	[thread overview]
Message-ID: <56B4BAE6.5040606@redhat.com> (raw)
In-Reply-To: <c32c3fc895ed2dd7e84353a21e99cddc@simark.ca>

On 02/05/2016 03:02 PM, Simon Marchi wrote:
> On 2016-02-05 09:51, Pedro Alves wrote:
>> Did you consider a convenience function to convert a value
>> to string, instead?  Then you'd write:
>>
>>  (gdb) printf "Visiting node of type %s\n", $_as_string(node)
>>
>> And maybe do other things with it.
> 
> No, but I think it's a good idea.
> 
> Do you see _as_string as applicable to any type, a bit like str() in 
> Python, or just to some specific types that we chose and make sense 
> (like enum)?

I was thinking the former.  Maybe even implement it in Python, in
gdb/python/lib/gdb/function/?

Thanks,
Pedro Alves


  reply	other threads:[~2016-02-05 15:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 14:18 Simon Marchi
2016-02-05 14:51 ` Pedro Alves
2016-02-05 15:03   ` Simon Marchi
2016-02-05 15:08     ` Pedro Alves [this message]
2016-02-05 14:53 ` Eli Zaretskii
2016-02-05 19:58   ` 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=56B4BAE6.5040606@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