qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] gdbstub: allow byte swapping for reading/writin


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH] gdbstub: allow byte swapping for reading/writing registers
Date: Wed, 15 Jan 2014 00:01:06 +0100

On 14.01.2014, at 23:55, Peter Maydell <address@hidden> wrote:

> On 14 January 2014 22:40, Alexander Graf <address@hidden> wrote:
>> Uli, I thought ppc64le gdb wasn't finalized yet? What does the gdbstub
>> layout look like? Are all fields the same as ppc64(be) but simply byte
>> swapped - including FPR ones?
> 
>> This is quite invasive (and prone to get wrong). If we really just have
>> to swap every single register by its size (which we yet have to confirm
>> with Uli) why don't we just wrap this function by another one that takes
>> the return value of ppc_cpu_gdb_read_register (the integer size) and
>> swaps it in-place in mem_buf? At least we're 100% consistent that way.
> 
> Note that we already support "fields in the buffer are in target byte order"
> (ie matching TARGET_WORDS_BIGENDIAN) with gdb_get_reg*,
> "fields are always LE" (use st*_le_p()) and "fields are always BE"
> (use st*_be_p()).
> 
> Is the underlying issue here that we might have a CPU which is
> in littleendian mode but in a QEMU executable compiled with
> TARGET_WORDS_BIGENDIAN ?  (If so I can't help feeling that
> the gdb stub is only the tip of the iceberg for things that might need
> attention...)

Yes, which is going to be the same problem you have for AArch64 :). LE vs BE is 
really just a register flip. The qemu binary is the same for both when you run 
system emulation mode.


Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]