Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Elena Zannoni <ezannoni@redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Print vector registers in natural format, not hex
Date: Fri, 18 Oct 2002 16:23:00 -0000	[thread overview]
Message-ID: <15792.38707.400671.968851@localhost.redhat.com> (raw)
In-Reply-To: <20021004213637.GA19907@nevyn.them.org>

Daniel Jacobowitz writes:
 > On Fri, Oct 04, 2002 at 05:11:27PM -0400, Klee Dienes wrote:
 > > On Friday, October 4, 2002, at 04:53 PM, Daniel Jacobowitz wrote:
 > > 
 > > >Just got one nit.
 > > >
 > > >First of all, in characters
 > > >  v16_int8 = {'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', '@', 'I', 
 > > >'\017', '°', 'Z', '@', '-', '°', 'Z', 'T'}
 > > >
 > > >is more natural to me.  It's a vector of chars, not a string.
 > > >
 > > >Secondly, this is an 'int8' type.  Are characters really the way to go?
 > > 
 > > Although I agree with you, that's not really a result of this patch, 
 > > but rather long-standing GDB behavior.  The patch is only causing $v1 
 > > to be printed according to its type declaration, which in this case is:
 > > 
 > > type = union __gdb_builtin_type_vec128 {
 > >     int128_t uint128;
 > >     float v4_float[4];
 > >     int32_t v4_int32[4];
 > >     int16_t v8_int16[8];
 > >     int8_t v16_int8[16];
 > > }
 > > 
 > > Then the following code in c-valprint.c causes it to be printed as a 
 > > string:
 > > 
 > >           /* For an array of chars, print with string syntax.  */
 > >           if (eltlen == 1 &&
 > >               ((TYPE_CODE (elttype) == TYPE_CODE_INT)
 > >                || ((current_language->la_language == language_m2)
 > >                    && (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
 > >               && (format == 0 || format == 's'))
 > > 
 > > You could probably make a good case that arrays of 'int' should be 
 > > printed as you describe, but that's a debate I'll leave to someone else.
 > 
 > Ah, you're right.  Thanks for the detail.
 > 

And you haven't noticed this comment in the testfile, I take it :-) I
discovered this while writing the vector support, but didn't fix it. I
don't know that it actually needs to be fixed. It's a feature, not a
bug, one could argue.

# Note: in LE case, the char array is printed WITHOUT the last character.
# Gdb treats the terminating null char in the array like the terminating
# null char in a string and doesn't print it. This is not a failure, but
# the way gdb works.

Elena


 > Otherwise, I like Klee's patch... anyone else?
 > 
 > -- 
 > Daniel Jacobowitz
 > MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2002-10-18 23:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-04 13:41 Klee Dienes
2002-10-04 13:52 ` Daniel Jacobowitz
2002-10-04 14:11   ` Klee Dienes
2002-10-04 14:36     ` Daniel Jacobowitz
2002-10-18 16:23       ` Elena Zannoni [this message]
2002-11-04 20:02         ` Klee Dienes
2002-11-04 20:34           ` Daniel Jacobowitz
2002-10-05 10:29 ` Eli Zaretskii
2002-10-05 13:03   ` Klee Dienes
2002-10-06 11:31     ` Eli Zaretskii
2002-10-11  9:26       ` Klee Dienes
2002-10-12  2:01         ` Eli Zaretskii
2002-10-21 17:23         ` Andrew Cagney
2002-10-18 16:37 ` Elena Zannoni
2002-11-05  0:48   ` Klee Dienes

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=15792.38707.400671.968851@localhost.redhat.com \
    --to=ezannoni@redhat.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /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