From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57167 invoked by alias); 11 Mar 2016 12:18:32 -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 57147 invoked by uid 89); 11 Mar 2016 12:18:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*o:Research, dark, our X-HELO: e06smtp17.uk.ibm.com Received: from e06smtp17.uk.ibm.com (HELO e06smtp17.uk.ibm.com) (195.75.94.113) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 11 Mar 2016 12:18:31 +0000 Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 11 Mar 2016 12:18:27 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 11 Mar 2016 12:18:25 -0000 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: arnez@linux.vnet.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 13C7C17D8056 for ; Fri, 11 Mar 2016 12:18:54 +0000 (GMT) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u2BCIOfe63963238 for ; Fri, 11 Mar 2016 12:18:24 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u2BCIOie016303 for ; Fri, 11 Mar 2016 07:18:24 -0500 Received: from oc1027705133.ibm.com (dyn-9-152-212-180.boeblingen.de.ibm.com [9.152.212.180]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u2BCIOab016280 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Mar 2016 07:18:24 -0500 From: Andreas Arnez To: Marcin =?utf-8?Q?Ko=C5=9Bcielnicki?= Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 4/8] gdb/s390: Fill gen_return_address hook. References: <1453637529-26972-5-git-send-email-koriakin@0x04.net> <1454853751-18455-1-git-send-email-koriakin@0x04.net> <56E2AD82.3060101@0x04.net> Date: Fri, 11 Mar 2016 12:18:00 -0000 In-Reply-To: <56E2AD82.3060101@0x04.net> ("Marcin \=\?utf-8\?Q\?Ko\=C5\=9Bcielni\?\= \=\?utf-8\?Q\?cki\=22's\?\= message of "Fri, 11 Mar 2016 12:35:30 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16031112-0005-0000-0000-00000AC3143F X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00186.txt.bz2 On Fri, Mar 11 2016, Marcin Ko=C5=9Bcielnicki wrote: > We could also try to collect 14*(%r11), hoping that's the > save slot for %r14, but the interface unfortunately doesn't support > collecting multiple values (no matter what the comment above says). Nah, that doesn't help either, since most functions don't use r11 as a frame pointer. There is just no way to locate the return address unless we have call frame information or perform code analysis. > Unfortunately, this interface is just not very well-designed - both > x86 and aarch64 just take a shot in the dark like this patch. A > better way would be to reuse the existing unwinders and remove this > hook altogether, or (for while-stepping, where we can't predict the > PC) actually allow multiple values and aim at a few likely locations. > But IMO that's not in scope for this patchset. The point I was trying to make is that r14 is fairly *unlikely* to contain the return address, unless we're near function entry. If we just called a function, then r14 contains an address within our own function. Otherwise r14 can also contain something else entirely. Is there a way to admit that we don't know the return address? What if we always return garbage? E.g., maybe it's better to always return 0? --=20 Andreas