From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11922 invoked by alias); 14 Nov 2001 21:21:12 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11900 invoked from network); 14 Nov 2001 21:21:10 -0000 Received: from unknown (HELO localhost.cygnus.com) (216.138.202.10) by sourceware.cygnus.com with SMTP; 14 Nov 2001 21:21:10 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id C83A33CF6; Wed, 14 Nov 2001 16:21:09 -0500 (EST) Message-ID: <3BF2E045.5060906@cygnus.com> Date: Mon, 05 Nov 2001 14:48:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.3) Gecko/20011020 X-Accept-Language: en-us MIME-Version: 1.0 To: Michael Snyder Cc: gdb-patches@sources.redhat.com, cagney@redhat.com, jimb@redhat.com Subject: Re: [RFA] Update D10V target to use new Harvardized type casts. References: <200111142057.fAEKvKB12616@reddwarf.cygnus.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2001-11/txt/msg00063.txt.bz2 > This one-line change lets the D10V back-end recognize the new > Harvardized type casts eg. "(@code int *)", so that a pointer > can be forced into the address space of choice. > > The exact same change can be used for (most) other Harvard back-ends. (I quit as d10v maintainer :-) Yes, looks ok. One thought, though, should that test: ... == FUNC || ... == METHOD || ... == CODE_SPACE be abstracted out? Every harvard target I've looked at has had that same test. Andrew > 2001-11-14 Michael Snyder > > * d10v-tdep.c (d10v_pointer_to_address): Use new type flag > TYPE_FLAG_CODE_SPACE to recognize a pointer that has been cast > into the instruction address space. > > Index: d10v-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/d10v-tdep.c,v > retrieving revision 1.25 > diff -p -r1.25 d10v-tdep.c > *** d10v-tdep.c 2001/10/15 18:18:29 1.25 > --- d10v-tdep.c 2001/11/14 20:56:37 > *************** d10v_pointer_to_address (struct type *ty > *** 413,419 **** > > /* Is it a code address? */ > if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC > ! || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD) > return d10v_make_iaddr (addr); > else > return d10v_make_daddr (addr); > --- 413,420 ---- > > /* Is it a code address? */ > if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC > ! || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD || > ! (TYPE_FLAGS (TYPE_TARGET_TYPE (type)) & TYPE_FLAG_CODE_SPACE) != 0) > return d10v_make_iaddr (addr); > else > return d10v_make_daddr (addr); > >