From patchwork Tue Mar 15 11:11:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 11338 Received: (qmail 19774 invoked by alias); 15 Mar 2016 11:11:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 19694 invoked by uid 89); 15 Mar 2016 11:11:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Actions, Hmm, Hx-languages-length:4238, belows X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 15 Mar 2016 11:11:12 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 5BB1E7F6B1; Tue, 15 Mar 2016 11:11:11 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2FBB9dk016114; Tue, 15 Mar 2016 07:11:09 -0400 Subject: Re: [PATCH 4/8] gdb/s390: Fill gen_return_address hook. To: Eli Zaretskii References: <1453637529-26972-5-git-send-email-koriakin@0x04.net> <1454853751-18455-1-git-send-email-koriakin@0x04.net> <56E2AD82.3060101@0x04.net> <56E2B95F.7050701@0x04.net> <56E2E7C8.7050901@redhat.com> <56E2FA1B.7050808@redhat.com> <83shzwj2wt.fsf@gnu.org> <56E31062.7020707@redhat.com> <83h9gcizcb.fsf@gnu.org> Cc: arnez@linux.vnet.ibm.com, koriakin@0x04.net, gdb-patches@sourceware.org From: Pedro Alves Message-ID: <56E7EDCC.8040400@redhat.com> Date: Tue, 15 Mar 2016 11:11:08 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <83h9gcizcb.fsf@gnu.org> On 03/11/2016 07:33 PM, Eli Zaretskii wrote: >> Cc: arnez@linux.vnet.ibm.com, koriakin@0x04.net, gdb-patches@sourceware.org >> From: Pedro Alves >> Date: Fri, 11 Mar 2016 18:37:22 +0000 >> >> On 03/11/2016 06:16 PM, Eli Zaretskii wrote: >>>> Cc: Eli Zaretskii , >>>> Marcin Kościelnicki >>>> , >>>> gdb-patches@sourceware.org >>>> From: Pedro Alves >>>> Date: Fri, 11 Mar 2016 17:02:19 +0000 >>>> >>>>> @item $_ret >>>>> Collect the return address. This is helpful if you want to see more >>>>> -of a backtrace. >>>>> +of a backtrace. Note that the return address can not always be >>>>> +determined reliably, and a wrong address may be collected instead. >>>>> +The reliability is usually higher for tracepoints at function entry. >>>> >>>> Hmm, this reads a bit as if the backtrace will be incorrect/bogus >>>> later on, which is not true. >>>> >>>> How about a merge of your suggestion with Marcin's previous reply, >>>> and some extras on top: >>>> >>>> @item $_ret >>>> Collect the set of memory addresses and/or registers necessary to compute >>>> the frame's return address. This is helpful if you want to see >>>> more of a backtrace. >>>> >>>> @emph{Note:} The necessary set can not always be reliability determined up >>>> front, and the wrong address / registers may end up collected instead. >>>> The reliability is usually higher for tracepoints at function entry. >>>> When this happens, backtracing will stop because the return address >>>> is found unavailable (unless another collect rule happened to match it). >>> >>> Maybe it's me, but I don't see the significant difference between >>> these two versions. >> >> I think the original version can be misinterpreted as if the >> backtrace will show the wrong caller when the wrong address >> is collected. This version clarifies that it won't. > > My reading is the other way around: the original version only talks > about the return address, while the modified one talks about a set of > addresses. I see what you mean. I reverted part of the change, and made the note say the simpler "location" instead now. > Anyway, if you are happier with your proposal, I won't object. Below's what I pushed. Thanks! From 45fa2529db961adff41c52c3a560808cb135beb2 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 15 Mar 2016 11:08:52 +0000 Subject: [PATCH] Document possible unreliability of '$_ret' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gdb/doc/ChangeLog: 2016-03-15 Pedro Alves Andreas Arnez Marcin Kościelnicki * gdb.texinfo (Tracepoint Actions): Document possible unreliability of '$_ret'. --- gdb/doc/ChangeLog | 7 +++++++ gdb/doc/gdb.texinfo | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 3d49085..0606d9d 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,10 @@ +2016-03-15 Pedro Alves + Andreas Arnez + Marcin KoÅ›cielnicki + + * gdb.texinfo (Tracepoint Actions): Document possible + unreliability of '$_ret'. + 2016-03-11 Andrew Burgess * gdb.texinfo (Symbols): Document new 'maint info line-table' diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index bf7df35..5f88335 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -12878,6 +12878,13 @@ Collect all local variables. Collect the return address. This is helpful if you want to see more of a backtrace. +@emph{Note:} The return address location can not always be reliability +determined up front, and the wrong address / registers may end up +collected instead. On some architectures the reliability is higher +for tracepoints at function entry, while on others it's the opposite. +When this happens, backtracing will stop because the return address is +found unavailable (unless another collect rule happened to match it). + @item $_probe_argc Collects the number of arguments from the static probe at which the tracepoint is located.