This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] failed to build sim/ppc on OSX.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Masaki Muranaka <monaka at monami-software dot com>
- Cc: gdb-patches at sourceware dot org, fche at redhat dot com
- Date: Mon, 1 Feb 2010 11:31:25 +0400
- Subject: Re: [patch] failed to build sim/ppc on OSX.
- References: <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