On 1 October 2013 23:23, Fabien Chouteau <chout...@adacore.com> wrote: > On 10/01/2013 03:08 AM, Peter Maydell wrote: >> I like this generally, but this detail is wrong. These changes >> mean that these registers (and many others) are now described >> as being int64_t wide rather than target_long wide, so you'll >> find that on 32 bit x86 they will read/write incorrectly. >> This is why I suggested that you need to have target-i386/monitor.c >> do an >> #if TARGET_LONG_BITS == 32 >> #define MD_TLONG MD_I32 >> #else >> #define MD_TLONG MD_I64 >> #endif >> >> and then specifically mark these fields as MD_TLONG. > > This seems complicated. Is there a way to use target_long in monitor.h?
I would prefer it if we didn't, because the monitor should not depend on target-specifics. So the monitor's interface to the CPU dependent parts should expose basic "always the same" types, and if a particular CPU happens to have CPU struct fields which are sometimes 32 bit and sometimes 64 bit then it has to deal with them itself. (Not every CPU has that kind of field.) -- PMM