From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2462 invoked by alias); 12 Jun 2012 16:53:36 -0000 Received: (qmail 2452 invoked by uid 22791); 12 Jun 2012 16:53:33 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp02.br.ibm.com (HELO e24smtp02.br.ibm.com) (32.104.18.86) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Jun 2012 16:53:19 +0000 Received: from /spool/local by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 12 Jun 2012 13:53:16 -0300 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 12 Jun 2012 13:53:14 -0300 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id 14211352004D for ; Tue, 12 Jun 2012 12:53:13 -0400 (EDT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5CGofnU2367646 for ; Tue, 12 Jun 2012 13:50:41 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5CEr7Lo030886 for ; Tue, 12 Jun 2012 11:53:07 -0300 Received: from [9.12.229.113] ([9.12.229.113]) by d24av01.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q5CEr4vB030793; Tue, 12 Jun 2012 11:53:05 -0300 Message-ID: <4FD773F3.1090307@linux.vnet.ibm.com> Date: Tue, 12 Jun 2012 16:53:00 -0000 From: Edjunior Barbosa Machado User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: "Gustavo, Luis" CC: Joel Brobecker , Anton Blanchard , gdb-patches@sourceware.org Subject: Re: [PATCH 1/3] Fix ppc64 single step over atomic sequence testcase References: <20120606135557.7da37cbe@kryten> <20120611193326.GN2687@adacore.com> <20120612224515.15bc044d@kryten> <4FD73EB2.3070705@mentor.com> <20120612131650.GP2687@adacore.com> <4FD743FA.4010403@mentor.com> In-Reply-To: <4FD743FA.4010403@mentor.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12061216-2194-0000-0000-00000220DC91 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: 2012-06/txt/msg00364.txt.bz2 Hi, On 06/12/2012 10:28 AM, Luis Gustavo wrote:> On 06/12/2012 10:16 AM, Joel Brobecker wrote: >>> GDB is supposed to skip eacho sequence (__asm__ block) in response >>> to a "next", but it may have had its behavior changed from when i >>> originally wrote this. It seems to take multiple next's to get to a >>> different __asm__ block now, so it seems to be broken. >>> >>> It may be a difference in GCC's debuginfo output or GDB just got >>> smarter. >> >> I might be wrong, but I don't remember us changing anything in this >> area. "next/step" behavior is really determined by the line info >> generated by the compiler. If the compiler was changed from not >> generated a line entry for the __asm__ blocks, and now does, then >> it'll change GDB's behavior. If next/step behavior testing is >> important to the testcase, then it would seem to make sense to >> convert the testcase to using an assembly file instead. >> It seems that's pretty much what's happening here. When checking the testcase built using gcc 4.3.4, got the following line number statements: ... Special opcode 34: advance Address by 8 to 0x100005a8 and Line by 1 to 25 Special opcode 35: advance Address by 8 to 0x100005b0 and Line by 2 to 27 Special opcode 139: advance Address by 36 to 0x100005d4 and Line by 8 to 35 Special opcode 139: advance Address by 36 to 0x100005f8 and Line by 8 to 43 Special opcode 20: advance Address by 4 to 0x100005fc and Line by 1 to 44 and the tests passes with only 2 'next's, while gcc 4.7.0 (from Fedora 17) provides the following: ... Special opcode 48: advance Address by 12 to 0x10000670 and Line by 1 to 25 Special opcode 67: advance Address by 16 to 0x10000680 and Line by 6 to 31 Special opcode 15: advance Address by 4 to 0x10000684 and Line by -4 to 27 Special opcode 24: advance Address by 4 to 0x10000688 and Line by 5 to 32 Special opcode 14: advance Address by 4 to 0x1000068c and Line by -5 to 27 Advance Line by 12 to 39 Special opcode 89: advance Address by 24 to 0x100006a4 and Line by 0 to 39 Special opcode 15: advance Address by 4 to 0x100006a8 and Line by -4 to 35 Special opcode 24: advance Address by 4 to 0x100006ac and Line by 5 to 40 Special opcode 14: advance Address by 4 to 0x100006b0 and Line by -5 to 35 Special opcode 111: advance Address by 28 to 0x100006cc and Line by 8 to 43 Special opcode 20: advance Address by 4 to 0x100006d0 and Line by 1 to 44 requiring more 'next's to go though the code. > > I agree that using an assembly file is both more apropriate and more > straightforward when it comes to testing these sequences. > > Luis > > > I had the chance to test the patch and rewriting this in assembly does fixes the tests regardless of gcc version. However, the only "issue" I noticed was that it should be run inside the src directory, otherwise it will fail due to the asm .include's: spawn -ignore SIGHUP gcc ../../../gdb.git/gdb/testsuite/gdb.arch/ppc64-atomic-inst.s -g -lm -o /home/emachado/gdb/build/gdb/testsuite/gdb.arch/ppc64-atomic-inst^M ../../../gdb.git/gdb/testsuite/gdb.arch/ppc64-atomic-inst.s: Assembler messages:^M ../../../gdb.git/gdb/testsuite/gdb.arch/ppc64-atomic-inst.s:1: Error: can't open gdb.asm/common.inc for reading: No such file or directory^M ../../../gdb.git/gdb/testsuite/gdb.arch/ppc64-atomic-inst.s:2: Error: can't open gdb.asm/powerpc64.inc for reading: No such file or directory^M ../../../gdb.git/gdb/testsuite/gdb.arch/ppc64-atomic-inst.s:5: Error: Unrecognized opcode: `gdbasm_declare'^M Thanks and regards, -- Edjunior