qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] mips64 gdbstub broken
@ 2007-11-10 14:53 Paul Brook
  0 siblings, 0 replies; only message in thread
From: Paul Brook @ 2007-11-10 14:53 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: qemu-devel

A recent CVS commit ("Fix gdb stub for MIPS64.") looks incorrect:

> diff -u -r1.66 -r1.67
> --- gdbstub.c   8 Oct 2007 13:16:14 -0000       1.66
> +++ gdbstub.c   25 Oct 2007 21:30:37 -0000      1.67
> @@ -563,7 +563,7 @@
>          ptr += sizeof(target_ulong);
>        }
>
> -    *(target_ulong *)ptr = tswapl(env->CP0_Status);
> +    *(target_ulong *)ptr = (int32_t)tswap32(env->CP0_Status);
>      ptr += sizeof(target_ulong);

This is obviously bogus. The new value sent to gdb will depend on the host 
endianness. 

I suspect what you meant to do is

  *(target_ulong *)ptr = tswapl((int32_t)env->CP0_Status);

i.e. sign extended to a target-endian 64-bit value. This is consistent with 
the implementation of cpu_gdb_write_registers.

Could you confirm?

Paul

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-10 14:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-10 14:53 [Qemu-devel] mips64 gdbstub broken Paul Brook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).