From: Michael Snyder <msnyder@redhat.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: Michael Snyder <msnyder@cygnus.com>,
gdb-patches@sources.redhat.com, jimb@redhat.com
Subject: Re: [PATCH] d10v_make_iaddr: make it idempotent.
Date: Fri, 12 Apr 2002 17:34:00 -0000 [thread overview]
Message-ID: <3CB77A2E.F72688E2@redhat.com> (raw)
In-Reply-To: <3CB76D5E.5040506@cygnus.com>
Andrew Cagney wrote:
>
> > 2002-04-12 Michael Snyder <msnyder@redhat.com>
> >
> > * d10v-tdep.c (d10v_make_iaddr): Make it idempotent,
> > in case it gets applied to an address that is already
> > in the instruction space.
>
> Michael, I don't understand this change. Why does it need to be
> idempotent - isn't that a bug somewhere else?
If you say "x/i 0x20001234", you don't want it to apply
the transform to that address.
> And why move the code?
Just because I called dq0v_iaddr_p. I have a preference
for ordering functions rather than adding prototypes.
I guess that's not the best thing to do...
>
> Andrew
>
> > Index: d10v-tdep.c
> > ===================================================================
> > RCS file: /cvs/cvsfiles/devo/gdb/d10v-tdep.c,v
> > retrieving revision 2.88
> > diff -c -3 -p -r2.88 d10v-tdep.c
> > *** d10v-tdep.c 2002/04/09 03:00:45 2.88
> > --- d10v-tdep.c 2002/04/12 22:47:30
> > *************** d10v_register_virtual_type (int reg_nr)
> > *** 356,373 ****
> > return builtin_type_int16;
> > }
> >
> > - static CORE_ADDR
> > - d10v_make_daddr (CORE_ADDR x)
> > - {
> > - return ((x) | DMEM_START);
> > - }
> > -
> > - static CORE_ADDR
> > - d10v_make_iaddr (CORE_ADDR x)
> > - {
> > - return (((x) << 2) | IMEM_START);
> > - }
> > -
> > static int
> > d10v_daddr_p (CORE_ADDR x)
> > {
> > --- 356,361 ----
> > *************** d10v_iaddr_p (CORE_ADDR x)
> > *** 380,385 ****
> > --- 368,387 ----
> > return (((x) & 0x3000000) == IMEM_START);
> > }
> >
> > + static CORE_ADDR
> > + d10v_make_daddr (CORE_ADDR x)
> > + {
> > + return ((x) | DMEM_START);
> > + }
> > +
> > + static CORE_ADDR
> > + d10v_make_iaddr (CORE_ADDR x)
> > + {
> > + if (d10v_iaddr_p (x))
> > + return x; /* Idempotency -- x is already in the IMEM space. */
> > + else
> > + return (((x) << 2) | IMEM_START);
> > + }
> >
> > static CORE_ADDR
> > d10v_convert_iaddr_to_raw (CORE_ADDR x)
> >
prev parent reply other threads:[~2002-04-13 0:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-12 15:51 Michael Snyder
2002-04-12 16:27 ` Andrew Cagney
2002-04-12 17:34 ` Michael Snyder [this message]
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=3CB77A2E.F72688E2@redhat.com \
--to=msnyder@redhat.com \
--cc=ac131313@cygnus.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