From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16294 invoked by alias); 9 Oct 2014 12:43:21 -0000 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 Received: (qmail 16284 invoked by uid 89); 9 Oct 2014 12:43:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Oct 2014 12:43:18 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1XcD3r-0005lb-6L from Yao_Qi@mentor.com ; Thu, 09 Oct 2014 05:43:15 -0700 Received: from GreenOnly (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.3.181.6; Thu, 9 Oct 2014 05:43:14 -0700 From: Yao Qi To: Doug Evans CC: gdb-patches Subject: Re: [PATCH 2/2] Fix implptr-optimized-out.exp fail in thumb mode References: <1411951921-16168-1-git-send-email-yao@codesourcery.com> <1411951921-16168-3-git-send-email-yao@codesourcery.com> Date: Thu, 09 Oct 2014 12:43:00 -0000 In-Reply-To: (Doug Evans's message of "Wed, 8 Oct 2014 11:31:59 -0400") Message-ID: <87vbnts9hv.fsf@codesourcery.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00201.txt.bz2 Doug Evans writes: > One question that comes to mind is: If this solution is going to > proliferate it would be good to convince ourselves there's no better > solution. I'm ok with this as a one-off here and there, but I'd like > to understand how many more of these will there be. Plus I can > imagine of course the number growing over time. There are three, dwz.exp, implptr-optimized-out.exp and dw2-ifort-parameter.exp, but you are right, the number will grow. > Can we, for example, enhance the dwarf assembler and provide a hook > for the thumb target to use to fix this there? ppc64 target has the similar problem too. We need a way suitable for {thumb, ppc64, other} x {gcc, clang}. Hacking dwarf assembler doesn't help much, because we are still unable to get the right function address. > > But *if* we do decide there's no better solution, there's a lot of > boilerplate here. Let me list the solutions I thought about and tried, so that we can evaluate which one is the best. - Tweak dwarf assembler to generate assembly debug info together with __thumb__ and __thumb2__, like #if defined (__thumb__) || defined (__thumb2__) .uleb128 main-1 /* DW_AT_low_pc */ #else .uleb128 main /* DW_AT_low_pc */ #endif this doesn't work because main in "main-1" is resolved to the function address (without lsb set). Unfortunately, "main-1+1" is resolved to the function address *with* lsb set. - The approach I proposed here, which should fix the problem on ppc64 (I didn't verify that on the real hardware). - Fix ld that stop setting function address lsb if they are in debug info. I didn't try. - Make use of local symbols. I find gcc/clang generates local symbol on t= he entry of the function but looks "-Wa,-L" doesn't keep them. --=20 Yao (=E9=BD=90=E5=B0=A7)