From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iqriq-0004z0-J5 for qemu-devel@nongnu.org; Sat, 10 Nov 2007 09:54:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iqriq-0004y9-14 for qemu-devel@nongnu.org; Sat, 10 Nov 2007 09:54:08 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iqrip-0004y6-Oh for qemu-devel@nongnu.org; Sat, 10 Nov 2007 09:54:07 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Iqrip-0001ZI-Pb for qemu-devel@nongnu.org; Sat, 10 Nov 2007 09:54:08 -0500 From: Paul Brook Date: Sat, 10 Nov 2007 14:53:59 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200711101454.01251.paul@codesourcery.com> Subject: [Qemu-devel] mips64 gdbstub broken Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thiemo Seufer Cc: qemu-devel@nongnu.org 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