From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78460 invoked by alias); 13 Mar 2016 09:53:11 -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 78441 invoked by uid 89); 13 Mar 2016 09:53:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1206, our, HContent-Transfer-Encoding:8bit X-HELO: xyzzy.0x04.net Received: from xyzzy.0x04.net (HELO xyzzy.0x04.net) (109.74.193.254) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 13 Mar 2016 09:53:08 +0000 Received: from hogfather.0x04.net (89-65-66-135.dynamic.chello.pl [89.65.66.135]) by xyzzy.0x04.net (Postfix) with ESMTPS id 9FA263FF2B; Sun, 13 Mar 2016 10:54:05 +0100 (CET) Received: from [192.168.13.5] (89-65-66-135.dynamic.chello.pl [89.65.66.135]) by hogfather.0x04.net (Postfix) with ESMTPSA id D42E05800F7; Sun, 13 Mar 2016 10:53:05 +0100 (CET) Subject: Re: [PATCH 4/8] gdb/s390: Fill gen_return_address hook. To: Andreas Arnez 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> Cc: gdb-patches@sourceware.org From: =?UTF-8?Q?Marcin_Ko=c5=9bcielnicki?= Message-ID: <56E53881.9000700@0x04.net> Date: Sun, 13 Mar 2016 09:53:00 -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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00206.txt.bz2 On 11/03/16 16:31, Andreas Arnez wrote: > On Fri, Mar 11 2016, Marcin Kościelnicki wrote: > >> We can always error() in there (and KFAIL the testcase in gdb.trace >> that exercises it). However, returning garbage here doesn't result in >> garbage backtrace - this only collects data, if the unwinder actually >> doing the work later determines it should look for the return address >> on the stack, it'll just ignore our collected $r14 and consider the >> return address unavailable (unless another collect rule happened to >> match it). > > Well, from that test case it appears that `$_ret' is generally not > expected to work very reliably. Since r14 usually does work near > function entry, this may be sufficient for now. > > So I'm OK with the patch. Please add a small comment stating that this > is a best-can-do approach that usually works near function entry and may > yield wrong results otherwise. > Thanks, pushed with this comment: /* The "gen_return_address" gdbarch method. Since this is supposed to be just a best-effort method, and we don't really have the means to run the full unwinder here, just collect the link register. */