Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Chris Moller <cmoller@redhat.com>, gdb-patches@sourceware.org
Subject: Re: pr 11067 patch
Date: Thu, 11 Feb 2010 19:50:00 -0000	[thread overview]
Message-ID: <m3wryjr1r0.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20100211092950.GC2907@adacore.com> (Joel Brobecker's message of 	"Thu, 11 Feb 2010 13:29:50 +0400")

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

>> Provides a little more info on enums for simple 'p <enum>' cases;
>> keeps the old format for complex cases like structs and arrays:

Joel> I feel really bad about this, and I really apologize - I am just
Joel> only suddenly wondering why this is considered a good idea, was
Joel> that discussed?

A little bit on the archer list, but not really directly.

Joel>   1. If I print 'e', GDB prints 'Val1' and that's OK.
Joel>   2. If I print 'Val1', GDB prints also prints 'Val1' and he says
Joel>      that, instead, GDB should print its numerical value.

Joel> I disagree on (2) because, if he wanted the numerical value, he should
Joel> have told GDB. For instance:

Joel>   (gdb) p GREEN
Joel>   $1 = GREEN
Joel>   (gdb) p /d GREEN
Joel>   $2 = 1

Joel> If people still think that this suggestion is a good one, I looked at
Joel> the patch (the least I could do)...

I asked Chris to work on this because I run into this with some
frequency.  I often will print some enum-typed value and get a symbolic
answer.  Then I have to type another command to get the numeric answer.

It seems mildly friendlier to simply always print it, at least at the
top level.  (In stack traces and in structures it may wind up being too
verbose, hence that decision.)

Differentiating cases 1 and 2 above is not really practical because the
evaluation and printing code are kept separate.

If you disagree strongly, then we could just close the PR and drop it, I
suppose.  I am not very intent on this, I just thought it would be a
nice, if minor, enhancement.  I didn't see a real downside.

Joel> Can you place each statement on their own line? I am guessing that
Joel> GNU indent will fix that anyway, and I also think that this is harder
Joel> to read.

I think we've abandoned any hope of using GNU indent.

Thanks for reviewing this.

Tom


  parent reply	other threads:[~2010-02-11 19:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-11  2:55 Chris Moller
2010-02-11  9:30 ` Joel Brobecker
2010-02-11 14:19   ` Chris Moller
2010-02-11 19:50   ` Tom Tromey [this message]
2010-02-12  4:11     ` Joel Brobecker
2010-02-12 15:48       ` Chris Moller
2010-02-13 11:49         ` Jan Kratochvil
2010-02-13 18:56           ` Chris Moller
2010-02-19 14:28             ` Joel Brobecker
2010-02-19 14:36               ` Jan Kratochvil
2010-02-19 14:45                 ` Joel Brobecker
2010-02-19 14:54                 ` Chris Moller
2010-02-19 18:50                   ` Jan Kratochvil
2010-02-19 19:52                     ` Chris Moller
2010-02-19 20:11                       ` Jan Kratochvil
2010-02-22  9:22                         ` Vladimir Prus
2010-02-23 23:55                         ` Tom Tromey
2010-03-11 15:44                           ` pr 11067 patch resurrected from the dead Chris Moller

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=m3wryjr1r0.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=cmoller@redhat.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