From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25160 invoked by alias); 17 Feb 2007 02:24:44 -0000 Received: (qmail 25145 invoked by uid 22791); 17 Feb 2007 02:24:42 -0000 X-Spam-Check-By: sourceware.org Received: from igw3.br.ibm.com (HELO igw3.br.ibm.com) (32.104.18.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 17 Feb 2007 02:24:36 +0000 Received: from mailhub1.br.ibm.com (unknown [9.18.232.109]) by igw3.br.ibm.com (Postfix) with ESMTP id 8BD0D3900F5 for ; Sat, 17 Feb 2007 00:20:35 -0200 (BrDT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v8.2) with ESMTP id l1H2O8Jt1159350 for ; Sat, 17 Feb 2007 00:24:18 -0200 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l1H2Mdq4032017 for ; Sat, 17 Feb 2007 00:22:39 -0200 Received: from [9.18.196.17] ([9.18.196.17]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l1H2MWaG031813 for ; Sat, 17 Feb 2007 00:22:39 -0200 Subject: Re: [patch] "single step" atomic instruction sequences as a whole. From: Luis Machado Reply-To: luisgpm@linux.vnet.ibm.com To: gdb-patches@sourceware.org Content-Type: text/plain Date: Sat, 17 Feb 2007 02:24:00 -0000 Message-Id: <1171678999.26782.16.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-02/txt/msg00212.txt.bz2 Emi, I tried your patch against the CVS head. GDB seems to handle this set of instructions just fine: 0x40000119a00 <._IO_puts+80>: beq- cr7,0x40000119a3c <._IO_puts +140> 0x40000119a04 <._IO_puts+84>: li r0,1 0x40000119a08 <._IO_puts+88>: lwarx r11,0,r3 0x40000119a0c <._IO_puts+92>: cmpw r11,r9 0x40000119a10 <._IO_puts+96>: bne- 0x40000119a1c <._IO_puts+108> 0x40000119a14 <._IO_puts+100>: stwcx. r0,0,r3 0x40000119a18 <._IO_puts+104>: bne+ 0x40000119a08 <._IO_puts+88> 0x40000119a1c <._IO_puts+108>: isync 0x40000119a20 <._IO_puts+112>: cmpwi cr7,r11,0 0x40000119a24 <._IO_puts+116>: bne- cr7,0x40000119b84 <._IO_puts +468> If i step through "lwarx", i end up with this: Stepping over an atomic sequence of instructions. Beginning at 0x0000040000119a08, break at 0x0000040000119a18 next time. 0x0000040000119a18 in ._IO_puts () from /lib64/power5/libc.so.6 So far so good. But if we continue executing the program we will eventually reach a set of instructions like this one: 0x40000119ae8 <._IO_puts+312>: lwarx r9,0,r3 0x40000119aec <._IO_puts+316>: stwcx. r0,0,r3 0x40000119af0 <._IO_puts+320>: bne+ 0x40000119ae8 <._IO_puts+312> At this point, GDB keeps stepping through the lwarx and stwcx instructions endlessly. If i hit continue right after the first breakpoint (0x40000119a08), the program ends normally I tested the same instruction block with Paul's patch and this did not happen, stating that it skipped the atomic instruction set as usual, and ending the program. I'm trying to figure out what is going on exactly. Regards, Luis