* [patch] failed to build sim/ppc on OSX.
@ 2010-01-31 17:07 Masaki Muranaka
2010-02-01 7:32 ` Joel Brobecker
0 siblings, 1 reply; 3+ messages in thread
From: Masaki Muranaka @ 2010-01-31 17:07 UTC (permalink / raw)
To: gdb-patches
Hello maintainers,
I failed to build sim/ppc on OSX with a warning.
I think this issue is occurred not only OSX.
Thanks,
sim/ppc/ChangeLog
2010-01-31 Masaki Muranaka <monaka@monami-software.com>
* interrupts.c (alignement_interrupt): Add type cast.
diff --git a/sim/ppc/interrupts.c b/sim/ppc/interrupts.c
index dafb2b3..f9e6efc 100644
--- a/sim/ppc/interrupts.c
+++ b/sim/ppc/interrupts.c
@@ -263,7 +263,7 @@ alignment_interrupt(cpu *processor,
case USER_ENVIRONMENT:
case VIRTUAL_ENVIRONMENT:
- cpu_error(processor, cia, "alignment interrupt - ra=0x%lx", ra);
+ cpu_error(processor, cia, "alignment interrupt - ra=0x%lx", (unsigned long)ra);
case OPERATING_ENVIRONMENT:
DAR = (spreg)ra;
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch] failed to build sim/ppc on OSX.
2010-01-31 17:07 [patch] failed to build sim/ppc on OSX Masaki Muranaka
@ 2010-02-01 7:32 ` Joel Brobecker
2010-02-01 9:10 ` Masaki Muranaka
0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2010-02-01 7:32 UTC (permalink / raw)
To: Masaki Muranaka; +Cc: gdb-patches, fche
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] failed to build sim/ppc on OSX.
2010-02-01 7:32 ` Joel Brobecker
@ 2010-02-01 9:10 ` Masaki Muranaka
0 siblings, 0 replies; 3+ messages in thread
From: Masaki Muranaka @ 2010-02-01 9:10 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches, fche
Hello Joel and fche,
Hmm. I'm thoughtless about this issue.
It is caused by 32bit/64bit as you say.
There is similar type casts in sim/ppc/vm_n.h, so it's harmless to apply
my patch. (And useful to fix build failure on OSX.)
But I agree there should be applied the another better fix.
Please reject that patch. I'll try to fix this issue again later.
Thanks,
On 2010/02/01, at 16:31, Joel Brobecker wrote:
>> 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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-02-01 9:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-31 17:07 [patch] failed to build sim/ppc on OSX Masaki Muranaka
2010-02-01 7:32 ` Joel Brobecker
2010-02-01 9:10 ` Masaki Muranaka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox