Received: from [140.186.70.92] (port=32948 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrCyW-0001k2-3k for qemu-devel@nongnu.org; Sun, 20 Feb 2011 12:21:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrCyU-0006OK-KF for qemu-devel@nongnu.org; Sun, 20 Feb 2011 12:21:35 -0500 Received: from adelie.canonical.com ([91.189.90.139]:36363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrCyU-0006O9-Er for qemu-devel@nongnu.org; Sun, 20 Feb 2011 12:21:34 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1PrCyT-0003QK-QH for ; Sun, 20 Feb 2011 17:21:33 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 33D2C2E80FC for ; Sun, 20 Feb 2011 17:21:31 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Sun, 20 Feb 2011 17:10:59 -0000 From: Aurelien Jarno Sender: bounces@canonical.com References: <20080111082028.14423.41504.malonedeb@gangotri.ubuntu.com> Message-Id: <20110220171100.6679.580.launchpad@palladium.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 181951] Re: Single-stepping PPC targets chokes on branch instructions Reply-To: Bug 181951 <181951@bugs.launchpad.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ** Changed in: qemu Status: Fix Committed =3D> Fix Released -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/181951 Title: Single-stepping PPC targets chokes on branch instructions Status in QEMU: Fix Released Bug description: qemu CVS HEAD (11.01.2008) qemu-0.9.1 stable Single stepping (MSR_SE bit set in MSR) in qemu-system-ppc doesn't allow to step any branch instruction. Can be reproduced by boot a Linux image with a gdb something debuggable in the rootfs: / # gdb testprg GNU gdb 6.3.50.20050810 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and yo= u are welcome to change it and/or distribute copies of it under certain condi= tions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for deta= ils. This GDB was configured as "powerpc-linux"...Using host libthread_db li= brary "/lib/libthread_db.so.1". = (gdb) b main Breakpoint 1 at 0x10000520: file testprg.c, line 26. (gdb) run Starting program: testprg Breakpoint 1, main () at testprg.c:26 26 testprg.c: No such file or directory. in testprg.c (gdb) disassemble Dump of assembler code for function main: 0x1000050c :stwu r1,-32(r1) 0x10000510 :mflr r0 0x10000514 :stw r31,28(r1) 0x10000518 :stw r0,36(r1) 0x1000051c :mr r31,r1 0x10000520 :lis r9,4096 0x10000524 :addi r3,r9,2376 0x10000528 :crclr 4*cr1+eq 0x1000052c :bl 0x10010ad8 0x10000530 :lis r9,4096 ... (gdb) stepi 0x10000524 26 in testprg.c (gdb) stepi 0x10000528 26 in testprg.c (gdb) stepi 0x1000052c 26 in testprg.c (gdb) stepi <<< QEMU HANGS! >>> The issue can be resolved using this patch: Index: target-ppc/translate.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/qemu/qemu/target-ppc/translate.c,v retrieving revision 1.115 diff -u -r1.115 translate.c --- target-ppc/translate.c 24 Nov 2007 02:03:55 -0000 1.115 +++ target-ppc/translate.c 10 Jan 2008 13:54:36 -0000 @@ -2811,8 +2811,6 @@ #endif gen_op_b_T1(); gen_op_set_T0((long)tb + n); - if (ctx->singlestep_enabled) - gen_op_debug(); gen_op_exit_tb(); } else { gen_set_T1(dest); @@ -2823,8 +2821,6 @@ #endif gen_op_b_T1(); gen_op_reset_T0(); - if (ctx->singlestep_enabled) - gen_op_debug(); gen_op_exit_tb(); } } @@ -3007,8 +3003,6 @@ gen_op_btest_T1(ctx->nip); gen_op_reset_T0(); no_test: - if (ctx->singlestep_enabled) - gen_op_debug(); gen_op_exit_tb(); } out: