Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Masaki Muranaka <monaka@monami-software.com>
Cc: gdb-patches@sourceware.org, fche@redhat.com
Subject: Re: [patch] failed to build sim/ppc on OSX.
Date: Mon, 01 Feb 2010 07:32:00 -0000	[thread overview]
Message-ID: <20100201073125.GO26827@adacore.com> (raw)
In-Reply-To: <5D76F873-1960-49BC-AF83-321D4F099424@monami-software.com>

> sim/ppc/ChangeLog
> 2010-01-31  Masaki Muranaka  <monaka@monami-software.com>
> 
>        * interrupts.c (alignement_interrupt): Add type cast.

I don't know the sim code well enough to review this change.  However,
I can't help but wonder whether it might be incorrect or not.
I'm copying Frank who is not exactly responsible for the ppc sim,
but who is maintainer for the common part - perhaps he has some insight
he can share...

> -    cpu_error(processor, cia, "alignment interrupt - ra=0x%lx", ra);
> +    cpu_error(processor, cia, "alignment interrupt - ra=0x%lx", (unsigned long)ra);

ra is defined as "unsigned_word", which, depending on the
WITH_TARGET_WORD_BITSIZE can be either unsigned64 or unsigned32.
Isn't there a problem if the host long is 32bits while unsigned_word
is 64bit?

In GDB, we solve the same sort of issue (print target addresses stored
inside a host CORE_ADDR type) using a routine that does the printing.
I didn't search very hard, but at first sight, there does not appear
to be a similar routine.

Not sure what the best solution might be... I'd probably be lazy and
upcast to unsigned long long to make sure that ra is casted to 64bits
(assuming that this is even true at all in practice).

-- 
Joel


  reply	other threads:[~2010-02-01  7:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-31 17:07 Masaki Muranaka
2010-02-01  7:32 ` Joel Brobecker [this message]
2010-02-01  9:10   ` Masaki Muranaka

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=20100201073125.GO26827@adacore.com \
    --to=brobecker@adacore.com \
    --cc=fche@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=monaka@monami-software.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