From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32712 invoked by alias); 18 Oct 2002 23:23:03 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32702 invoked from network); 18 Oct 2002 23:23:03 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 18 Oct 2002 23:23:03 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g9IN22w25422 for ; Fri, 18 Oct 2002 19:02:02 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g9INN2f15206 for ; Fri, 18 Oct 2002 19:23:02 -0400 Received: from localhost.redhat.com (IDENT:At5EzCw0+NQ60QUxP/5QNoIzUdVY7afP@tooth.toronto.redhat.com [172.16.14.29]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g9INN1T16729 for ; Fri, 18 Oct 2002 19:23:02 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id EE298FF79; Fri, 18 Oct 2002 19:20:20 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <15792.38707.400671.968851@localhost.redhat.com> Date: Fri, 18 Oct 2002 16:23:00 -0000 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Print vector registers in natural format, not hex In-Reply-To: <20021004213637.GA19907@nevyn.them.org> References: <20021004205309.GA17616@nevyn.them.org> <20021004213637.GA19907@nevyn.them.org> X-SW-Source: 2002-10/txt/msg00314.txt.bz2 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: > >=20 > > >Just got one nit. > > > > > >First of all, in characters > > > v16_int8 =3D {'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', '@', 'I',=20 > > >'\017', '=B0', 'Z', '@', '-', '=B0', '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 g= o? > >=20 > > Although I agree with you, that's not really a result of this patch,=20 > > but rather long-standing GDB behavior. The patch is only causing $v1= =20 > > to be printed according to its type declaration, which in this case is: > >=20 > > type =3D 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]; > > } > >=20 > > Then the following code in c-valprint.c causes it to be printed as a=20 > > string: > >=20 > > /* For an array of chars, print with string syntax. */ > > if (eltlen =3D=3D 1 && > > ((TYPE_CODE (elttype) =3D=3D TYPE_CODE_INT) > > || ((current_language->la_language =3D=3D language_m2) > > && (TYPE_CODE (elttype) =3D=3D TYPE_CODE_CHAR))) > > && (format =3D=3D 0 || format =3D=3D 's')) > >=20 > > You could probably make a good case that arrays of 'int' should be=20 > > printed as you describe, but that's a debate I'll leave to someone els= e. >=20 > Ah, you're right. Thanks for the detail. >=20 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? >=20 > --=20 > Daniel Jacobowitz > MontaVista Software Debian GNU/Linux Developer