From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29601 invoked by alias); 24 Oct 2014 02:42:18 -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 29591 invoked by uid 89); 24 Oct 2014 02:42:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yh0-f48.google.com Received: from mail-yh0-f48.google.com (HELO mail-yh0-f48.google.com) (209.85.213.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 24 Oct 2014 02:42:16 +0000 Received: by mail-yh0-f48.google.com with SMTP id v1so2055157yhn.35 for ; Thu, 23 Oct 2014 19:42:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=DpKC70sdU5nraN/EbDMYHdGwLq6TRtiMJWf3VjDyVVw=; b=OjJu/FDk3dd9j1Vj3QlldtaAXckg3bg9dWnJVrIHO8mlWS6nB9JroRXST8qrFWrmlv 6IPy9fTcTTYDy88ZckcFuUXYCstQ/2FWCn6y646QCPviB6pkTJKwrN+/g+kcjX0uIv+W lf/PJmu6TJzLPnrJP12iaJ2SKrSdp8JQUi353PQDYeiW0ZO2YyonBnevfdC+TKwRtZ9O uGPAVVOVFF+T5hKcpnFD/7zcc166JLTFC0MrT6z6x4tsrINhBOTSbf1H8r0wPcvz6XYe sYlK4BNgx6FehzPJWIWYTUEWCB3LY4TZHKKvjuO2DxFc21YaybY5y6VAwmpLesvB9l4q qEgg== X-Gm-Message-State: ALoCoQnAIVelpHUq9v+gkkN2HLT0E+gKkvFNGaMtw6NyyQG8uHTSMCv9PKUC60F2dHjHn1+TKq2I MIME-Version: 1.0 X-Received: by 10.170.75.132 with SMTP id r126mr1698986ykr.122.1414118533894; Thu, 23 Oct 2014 19:42:13 -0700 (PDT) Received: by 10.229.250.4 with HTTP; Thu, 23 Oct 2014 19:42:13 -0700 (PDT) In-Reply-To: References: <201410231757.s9NHvX3r026780@d06av02.portsmouth.uk.ibm.com> Date: Fri, 24 Oct 2014 02:42:00 -0000 Message-ID: Subject: Re: [PATCH] Python API: Add gdb.is_in_prologue and gdb.is_in_epilogue. From: Doug Evans To: Daniel Gutson Cc: Martin Galvan , Ulrich Weigand , Pedro Alves , gdb-patches , Eli Zaretskii Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00622.txt.bz2 On Thu, Oct 23, 2014 at 11:13 AM, Daniel Gutson wrote: > On Thu, Oct 23, 2014 at 3:09 PM, Martin Galvan > wrote: >> On Thu, Oct 23, 2014 at 2:57 PM, Ulrich Weigand wr= ote: >>> The fundamental problem is that the notion of "prologue" and "epilogue" >>> simply no longer exists in optimized code generated by modern compilers; >>> and even more compiler features get implemented that make those notions >>> even less useful (e.g. shrink-wrapping). >>> >>> As a result, we have been trying to the rid of using those notions as >>> much as possible; for example, when debugging optimized code with modern >>> DWARF information present, GDB will today no longer even use prologue >>> skipping at all. Instead, the debug information is good enough that >>> the correct location of local variables can be recovered at every >>> instruction in the function, making the distinction no longer needed. >>> >>> The in_prologue routine is likewise only still uses under certain rather >>> rare circumstances; in fact it might even today be possible to simply >>> remove it. Once more platforms provide correct DWARF covering epilogues >>> as well, the gdbarch_in_function_epilogue_p calls in breakpoint.c may >>> likewise become unnecessary. >>> >>> So if we hope at some point to get rid of those routines, then it seems >>> counterproductive to now export them as part of a fixed external API ... >> >> While that may be true, it's also true that at some points we still >> see the local variables having wrong values when stepping through >> machine code. The aim of this patch is to expose a way of detecting >> such situations for scripts that may need it. Until we have a safer >> way to do it I think this should be integrated to the code base. > > Hi all, > (Hi Pedro!) > > we badly need this. If you think the patch is in a shape good enough > to be committed, please commit it for Mart=C3=ADn since he doesn't have > write access. > > We can then start a fresh new thread to discuss future directions > specially related to optimized code and exactly what/how DWARF > tags should be handled. Ulrich raises a valid point though. API design needs to be done with care. I'd rather not rush this.