From: Andrew Cagney <ac131313@cygnus.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: gdb-patches@sources.redhat.com, cagney@redhat.com, jimb@redhat.com
Subject: Re: [RFA] Update D10V target to use new Harvardized type casts.
Date: Mon, 05 Nov 2001 14:48:00 -0000 [thread overview]
Message-ID: <3BF2E045.5060906@cygnus.com> (raw)
In-Reply-To: <200111142057.fAEKvKB12616@reddwarf.cygnus.com>
> 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 <msnyder@redhat.com>
>
> * 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);
>
>
next prev parent reply other threads:[~2001-11-14 21:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-05 12:15 Michael Snyder
2001-11-05 14:48 ` Andrew Cagney [this message]
2001-11-05 15:37 ` Michael Snyder
2001-11-05 15:52 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3BF2E045.5060906@cygnus.com \
--to=ac131313@cygnus.com \
--cc=cagney@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@redhat.com \
--cc=msnyder@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox