From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47077 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCoSw-0000QO-4Y for qemu-devel@nongnu.org; Mon, 01 Nov 2010 03:06:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PCoSn-0004OC-TN for qemu-devel@nongnu.org; Mon, 01 Nov 2010 03:06:01 -0400 Received: from moutng.kundenserver.de ([212.227.126.187]:59757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PCoSn-0004Ni-Hz for qemu-devel@nongnu.org; Mon, 01 Nov 2010 03:05:53 -0400 Message-ID: <4CCE66CC.3080205@mail.berlios.de> Date: Mon, 01 Nov 2010 08:05:48 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 4/4] target-xxx: Use fprintf_function (format checking) References: <1287781413-26723-1-git-send-email-weil@mail.berlios.de> <1287781413-26723-4-git-send-email-weil@mail.berlios.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: TeLeMan Cc: Blue Swirl , QEMU Developers Am 01.11.2010 03:24, schrieb TeLeMan: > On Sat, Oct 23, 2010 at 05:03, Stefan Weil wrote: >> int eflags, i, nb; >> @@ -335,9 +333,11 @@ void cpu_dump_state(CPUState *env, FILE *f, >> (uint32_t)env->cr[2], >> (uint32_t)env->cr[3], >> (uint32_t)env->cr[4]); >> - for(i = 0; i < 4; i++) >> - cpu_fprintf(f, "DR%d=%08x ", i, env->dr[i]); >> - cpu_fprintf(f, "\nDR6=%08x DR7=%08x\n", env->dr[6], env->dr[7]); >> + for(i = 0; i < 4; i++) { >> + cpu_fprintf(f, "DR%d=" TARGET_FMT_lx " ", i, env->dr[i]); >> + } >> + cpu_fprintf(f, "\nDR6=" TARGET_FMT_lx " DR7=" TARGET_FMT_lx >> "\n", >> + env->dr[6], env->dr[7]); >> } > I think this patch is not right. Outputting 64bits data is not > necessary on 32bits mode. Do you speak of 32 bit hosts or 32 bit targets? dr is of type target_ulong, so its size depends on the target's word size. TARGET_FMT_lx is the correct format specifier for target_ulong. What would you propose? Cheers, Stefan