From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IvdXl-0006jG-9A for qemu-devel@nongnu.org; Fri, 23 Nov 2007 13:46:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IvdXk-0006ie-82 for qemu-devel@nongnu.org; Fri, 23 Nov 2007 13:46:24 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IvdXj-0006iV-T4 for qemu-devel@nongnu.org; Fri, 23 Nov 2007 13:46:23 -0500 Received: from honiara.magic.fr ([195.154.193.36]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IvdXj-0001NN-5h for qemu-devel@nongnu.org; Fri, 23 Nov 2007 13:46:23 -0500 Subject: Re: [Qemu-devel] qemu hw/ppc_oldworld.c target-ppc/cpu.h target-... From: Jocelyn Mayer In-Reply-To: <1195843374.24939.22.camel@jma4.dev.netgem.com> References: <1195840282.24939.14.camel@jma4.dev.netgem.com> <200711231822.53015.paul@codesourcery.com> <1195843374.24939.22.camel@jma4.dev.netgem.com> Content-Type: text/plain Date: Fri, 23 Nov 2007 19:46:21 +0100 Message-Id: <1195843581.24939.23.camel@jma4.dev.netgem.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: l_indien@magic.fr, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: l_indien@magic.fr, qemu-devel@nongnu.org On Fri, 2007-11-23 at 19:42 +0100, Jocelyn Mayer wrote: > On Fri, 2007-11-23 at 18:22 +0000, Paul Brook wrote: > > > Furthermore this patch was made in a brainless way, it will be reverted > > > asap. > > > If you think there is a bug in someone else code, submit it a patch, if > > > it's cleaver and addresses a real bug (which is not the case here) it > > > will be accepted and merged. > > > > The old code before the patch is obviously broken. It's mixing 64-bit > > (ppc_gpr_t) and 32-bit (target_ulong) values. > > It seems you do not understand that what was done was correct. It's not > mixing two different types. GPR are of ppc_gpr_t type and should be > displayed this way. The only case which is incorrect is not addressed by > your patch. But your patch breaks the general case which was OK. > > > > > As implied by the comments aboce the definition of ppc_gpt_t, and now > > explicitly in the above the definition of REGX, printing a ppc_gpr_t is > > obviously not meaningful. > > > > I don't claim that my patch is perfect, the code is still a bit of a mess. > > However, unlike the original code, it is at least self-consistent, and won't > > crash 64-bit hosts (The fact that it usually prints garbage rather than > > crashing is an accident of the x64-64 ABI). > > It's not garbage. On 64 bits hosts, the 64 bits GPR dump is correct. GPR > _are 64 bits_ when compiling the ppcemb target and should be displayed > as 64 bits value. It's not correct on 32 bits targets Sorry, I meant 32 bits _hosts_ here... > , because the > highest 32 bits of the GPR should be printed and they are not. Here's > the real bug. Your patch break the first case, which was OK, and does > not fix any actual bug. -- Jocelyn Mayer