qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3] target-ppc: gdbstub allow byte swapping for,


From: Thomas Falcon
Subject: Re: [Qemu-devel] [PATCH v3] target-ppc: gdbstub allow byte swapping for, reading/writing registers
Date: Mon, 20 Jan 2014 11:49:31 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131028 Thunderbird/17.0.10

On 01/20/2014 08:33 AM, Alexander Graf wrote:
On 17.01.2014, at 22:02, Thomas Falcon <address@hidden> wrote:

This patch allows registers to be properly read from and written to
when using the gdbstub to debug a ppc guest running in little
endian mode.  It accomplishes this goal by byte swapping the values of
any registers if the MSR:LE value is set.

Signed-off-by: Thomas Falcon <address@hidden>
---
Differences from v2:

Fixed formatting issues
Added logic to ensure only FP registers have a guaranteed size of 8 bytes

I don't really like how the write case has to know about the size of a register 
(maybe we could factor this out into a single function for all reads and 
writes?), but this is good enough for now :). However, I can't apply the patch 
as your email client seems to have broken the patch formatting.


Alex


I'm not sure of a way to swap the value without knowing its size.  In both read 
and write, the size needs to be known and is hardcoded in some  cases.  The 
write case cannot know the size without a conditional since we need to swap in 
mem_buf before we call ppc_cpu_gdb_write_register.  Maybe we could get around 
this by hanging ppc_cpu_gdb_write_register so that it returns a pointer to the 
register being overwritten, and then we could swap that instead of mem_buf?  
But even then I guess we would still need to check the size of the register 
before we called bswap32/64.

Anyway, sorry about the formatting issues again.  Should I just resubmit the 
patch as is?


Thanks,

Tom








reply via email to

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