From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HlCM8-0002e3-Q2 for qemu-devel@nongnu.org; Mon, 07 May 2007 19:11:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HlCM7-0002aY-8Z for qemu-devel@nongnu.org; Mon, 07 May 2007 19:11:00 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HlCM7-0002aQ-5s for qemu-devel@nongnu.org; Mon, 07 May 2007 19:10:59 -0400 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 1HlCF5-00076m-6b for qemu-devel@nongnu.org; Mon, 07 May 2007 19:03:43 -0400 From: Paul Brook Subject: Re: [Qemu-devel] workaround: qemu-0.9.0 emulating mipsel (32-bit R3000) on amd64 Date: Tue, 8 May 2007 00:03:36 +0100 References: <463E2234.3040508@BitWagon.com> <20070507121310.GA18535@caradoc.them.org> <463FAC29.306@BitWagon.com> In-Reply-To: <463FAC29.306@BitWagon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200705080003.37643.paul@codesourcery.com> 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 Cc: John Reiser On Monday 07 May 2007, John Reiser wrote: > Daniel Jacobowitz wrote: > > On Sun, May 06, 2007 at 09:04:52PM +0100, Thiemo Seufer wrote: > >>This looks like another instance of "Qemu/MIPS doesn't handle > >>self-modifying code correctly" (the break instructions inserted > >>by gdb are exactly this). > >> > >>A gross workaround is > >>http://lists.nongnu.org/archive/html/qemu-devel/2007-05/msg00037.html > > > > Someone might want to try: > > http://lists.nongnu.org/archive/html/qemu-devel/2007-04/msg00514.html > > This works for me so far: I can single-step reliably in gdb. > > --- a/qemu-0.9.0/target-mips/helper.c 2007-05-05 15:39:21.000000000 -0700 > +++ b/qemu-0.9.0/target-mips/helper.c 2007-05-07 13:24:50.000000000 -0700 > @@ -358,6 +358,7 @@ > goto set_EPC; > case EXCP_BREAK: > cause = 9; > + tlb_flush_page(env, env->PC); > goto set_EPC; > case EXCP_RI: > cause = 10; I think this is still broken if the breakpoint is the first instruction on a page. The changes Daniel mentioned should make this sort of flushing unnecessary. Paul