From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24334 invoked by alias); 4 Oct 2002 21:36:05 -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 24327 invoked from network); 4 Oct 2002 21:36:04 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 4 Oct 2002 21:36:04 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17xb32-0000YI-00 for ; Fri, 04 Oct 2002 17:35:52 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17xa7h-0005BQ-00 for ; Fri, 04 Oct 2002 17:36:37 -0400 Date: Fri, 04 Oct 2002 14:36:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Print vector registers in natural format, not hex Message-ID: <20021004213637.GA19907@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20021004205309.GA17616@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2002-10/txt/msg00142.txt.bz2 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. Otherwise, I like Klee's patch... anyone else? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer