From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10914 invoked by alias); 24 Sep 2013 17:39:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 10873 invoked by uid 89); 24 Sep 2013 17:39:25 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Sep 2013 17:39:25 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8OHYLSL009929 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 24 Sep 2013 13:34:21 -0400 Received: from barimba (ovpn-113-63.phx2.redhat.com [10.3.113.63]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r8OHYKZb002547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 24 Sep 2013 13:34:21 -0400 From: Tom Tromey To: Christoph Weinmann Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Remove C/C++ relevant code in Fortran specific file. References: <1380033831-22490-1-git-send-email-christoph.t.weinmann@intel.com> Date: Tue, 24 Sep 2013 17:39:00 -0000 In-Reply-To: <1380033831-22490-1-git-send-email-christoph.t.weinmann@intel.com> (Christoph Weinmann's message of "Tue, 24 Sep 2013 16:43:51 +0200") Message-ID: <87hadaktsz.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-09/txt/msg00875.txt.bz2 >>>>> "Christoph" == Christoph Weinmann writes: Christoph> Remove code relevant for printing C/C++ Integer values in a Christoph> Fortran specific file to unify printing of Fortran values. Looks good. A question below, and a minor nit. Christoph> --- a/gdb/f-valprint.c Christoph> +++ b/gdb/f-valprint.c Christoph> @@ -354,21 +354,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, Christoph> original_value, options, 0, stream); Christoph> } Christoph> else Christoph> - { Christoph> - val_print_type_code_int (type, valaddr + embedded_offset, stream); Christoph> - /* C and C++ has no single byte int type, char is used instead. Christoph> - Since we don't know whether the value is really intended to Christoph> - be used as an integer or a character, print the character Christoph> - equivalent as well. */ Christoph> - if (TYPE_LENGTH (type) == 1) Christoph> - { Christoph> - LONGEST c; Christoph> - Christoph> - fputs_filtered (" ", stream); Christoph> - c = unpack_long (type, valaddr + embedded_offset); Christoph> - LA_PRINT_CHAR ((unsigned char) c, type, stream); Christoph> - } Christoph> - } Christoph> + val_print_type_code_int (type, valaddr + embedded_offset, stream); Christoph> break; I wonder whether the whole "if" can be removed and simply call val_print_scalar_formatted. It's not that important, though. This part is fine as-is. Christoph> +# Check the printed output of small data types. Christoph> +gdb_test "print oneByte" ".* = 1.*" "Print the value of a one byte sized Integer type." Christoph> + Christoph> +gdb_test "print twobytes" ".*2 = 2.*" "Print the value of a two bytes sized Integer type." Christoph> + Christoph> +gdb_test "print chvalue" ".*3 = \'a\'.*" "Print the value of a Character type." Christoph> + Christoph> +gdb_test "print logvalue" ".*4 = \.TRUE\..*" "Print the value of a Logical type." These lines go over the line length limit and should be split. The patch is ok with this fixed. Tom