From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53880 invoked by alias); 16 May 2015 12:58:21 -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 53864 invoked by uid 89); 16 May 2015 12:58:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 16 May 2015 12:58:20 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 1910B2BB3A9 for ; Sat, 16 May 2015 12:58:19 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4GCwFQQ007834 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 16 May 2015 08:58:17 -0400 Date: Sat, 16 May 2015 12:58:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org, Phil Muldoon Subject: [commit] [PATCH v5 6/7] compile: New 'compile print' Message-ID: <20150516125814.GE9862@host1.jankratochvil.net> References: <20150513201615.4051.5261.stgit@host1.jankratochvil.net> <20150513201704.4051.40784.stgit@host1.jankratochvil.net> <55562703.4060104@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55562703.4060104@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00430.txt.bz2 On Fri, 15 May 2015 19:04:03 +0200, Pedro Alves wrote: > A couple very minor nits below, and this is good to go. > > On 05/13/2015 09:17 PM, Jan Kratochvil wrote: > > > + if (TYPE_CODE (gdb_type) != TYPE_CODE_PTR) > > + error (_("Invalid type code %d of symbol \"%s\" " > > + "in compiled module \"%s\"."), > > + TYPE_CODE (gdb_type_from_ptr), COMPILE_I_EXPR_VAL, > > + objfile_name (objfile)); > > + > > + switch (TYPE_CODE (gdb_type_from_ptr)) > > + { > > + case TYPE_CODE_ARRAY: > > + retval = gdb_type_from_ptr; > > + gdb_type_from_ptr = TYPE_TARGET_TYPE (gdb_type_from_ptr); > > + break; > > + case TYPE_CODE_FUNC: > > + retval = gdb_type_from_ptr; > > AFAIC, retval is always gdb_type_from_ptr, and could be > moved out of the switch. It was written this way as it has semantical logic - how the type is determined depends on TYPE_CODE_* of that object. Just accidentally in this case it is the same. I do not do performance micro-optimizations which compiler will do anyway. But I have changed it. > > + /* Inferior parameter out value address or NULL if the inferior function does not > > + have one. */ > > Line too long, I think. Yes, fixed. (Not discussing the 72 vs. 78 or 80 or which width of comments rule.) > Also, "NULL if the inferior function does not have one" looks like > a copy/paste, given this is not a pointer variable. It is "inferior NULL", so I find that "NULL" valid there. > I'd swap around the fields, and write: > > /* Inferior parameter out value type or NULL if the inferior function does not > have one. */ > struct type *out_value_type; > > /* If the inferior function has an out value, this is its address. */ > CORE_ADDR out_value_addr; Done although I have added line "Otherwise it is zero." there: + /* Inferior parameter out value type or NULL if the inferior function does not + have one. */ + struct type *out_value_type; + + /* If the inferior function has an out value, this is its address. + Otherwise it is zero. */ + CORE_ADDR out_value_addr; Without that line 'out_value_addr' would be unspecified if out_value_type is NULL which does not correspond to the current code. Checked in: 36de76f9cc2eea0bd5f1b7ce74ef60e1aa0b27c2 Jan