From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16912 invoked by alias); 27 Feb 2005 00:36:26 -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 16542 invoked from network); 27 Feb 2005 00:36:12 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 27 Feb 2005 00:36:12 -0000 Received: from drow by nevyn.them.org with local (Exim 4.44 #1 (Debian)) id 1D5CPo-00059e-57; Sat, 26 Feb 2005 19:36:08 -0500 Date: Sun, 27 Feb 2005 04:22:00 -0000 From: Daniel Jacobowitz To: Nathan Sidwell Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Unary plus Message-ID: <20050227003608.GC19138@nevyn.them.org> Mail-Followup-To: Nathan Sidwell , gdb-patches@sources.redhat.com References: <4209E2F1.2000504@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4209E2F1.2000504@codesourcery.com> User-Agent: Mutt/1.5.6+20040907i X-SW-Source: 2005-02/txt/msg00275.txt.bz2 On Wed, Feb 09, 2005 at 10:16:17AM +0000, Nathan Sidwell wrote: > Hi, > gdb doesn't parse or evaluate the unary plus operator (but does have one). > gdb.trace/collection.exp contains such an expression -- 'a[+b]'. This patch > adds the necessary parsing and evaluation machinery. > > built & tested on i686-px-linux-gnu and an unreleased architecture. ok? Two comments: - Could you add a non-tracepoint testcase for this? I think one good place would be gdb.cp/userdef.exp. > ! /* The unary operators +, - and ~. They free the argument ARG1 > ! (unless it is returned). */ > ! > ! struct value * > ! value_pos (struct value *arg1) > ! { > ! struct type *type; > ! > ! arg1 = coerce_ref (arg1); > ! > ! type = check_typedef (value_type (arg1)); > ! > ! if (TYPE_CODE (type) == TYPE_CODE_FLT) > ! return arg1; - IIUC, that's not quite right - we need an rvalue here. -- Daniel Jacobowitz CodeSourcery, LLC