From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L8JqY-0008SD-Ia for qemu-devel@nongnu.org; Thu, 04 Dec 2008 14:26:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L8JqX-0008RF-2y for qemu-devel@nongnu.org; Thu, 04 Dec 2008 14:26:46 -0500 Received: from [199.232.76.173] (port=51643 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L8JqW-0008R2-SL for qemu-devel@nongnu.org; Thu, 04 Dec 2008 14:26:44 -0500 Received: from csl.cornell.edu ([128.84.224.10]:1841 helo=vlsi.csl.cornell.edu) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L8JqV-0004nH-Ee for qemu-devel@nongnu.org; Thu, 04 Dec 2008 14:26:44 -0500 Received: from stanley.csl.cornell.edu (stanley.csl.cornell.edu [128.84.224.15]) by vlsi.csl.cornell.edu (8.13.4/8.13.4) with ESMTP id mB4JQWeQ013666 for ; Thu, 4 Dec 2008 14:26:37 -0500 (EST) Date: Thu, 4 Dec 2008 14:26:32 -0500 (EST) From: Vince Weaver Subject: Re: [Qemu-devel] Re: [patch] gdb-stub support for Alpha In-Reply-To: <4937FE1F.4000803@siemens.com> Message-ID: <20081204142401.E24640@stanley.csl.cornell.edu> References: <4937FE1F.4000803@siemens.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Thu, 4 Dec 2008, Jan Kiszka wrote: > I would suggest checking out what gets translated, executed and > communicated by using '-d in_asm,out_asm' for the qemu command line, > running qemu itself inside gdb and maybe also enabling 'set debug remote > 1' in the remote gdb instance (which will print the frontend<->backend > communication). That should help to get a better picture about what > happens and why you see double steps. Thanks! That helped track down the problem. On Alpha, for non-branch instructions the move of ctx->pc to cpu_pc happens at the end of the TB (after the single-step exception is called). However, for branches, the move of ctx->pc to cpu_pc happens within the instruction decoding, *before* the single-step exception is called, so the exception handler over-writes the proper new pc with an older one. This is tricky to fix. Either all the branch code needs to be re-written to write to a temporary nextpc value that is written at the end, or else I have to somehow wrap the single-step exception code to preserve the new pc value. Vince