From patchwork Mon Mar 7 10:19:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 11228 Received: (qmail 113825 invoked by alias); 7 Mar 2016 10:20:09 -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 113788 invoked by uid 89); 7 Mar 2016 10:20:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Hx-languages-length:2374, analyzer, enhances, prologue X-HELO: e06smtp08.uk.ibm.com Received: from e06smtp08.uk.ibm.com (HELO e06smtp08.uk.ibm.com) (195.75.94.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 07 Mar 2016 10:20:07 +0000 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 7 Mar 2016 10:20:02 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp08.uk.ibm.com (192.168.101.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 7 Mar 2016 10:19:59 -0000 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: arnez@linux.vnet.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 7D2171B08069 for ; Mon, 7 Mar 2016 10:20:23 +0000 (GMT) Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u27AJwpA3277168 for ; Mon, 7 Mar 2016 10:19:58 GMT Received: from d06av06.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u27AJwXT004533 for ; Mon, 7 Mar 2016 05:19:58 -0500 Received: from oc1027705133.ibm.com (dyn-9-152-212-180.boeblingen.de.ibm.com [9.152.212.180]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u27AJvAq004513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 7 Mar 2016 05:19:57 -0500 From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH] S390: Add use of unavailable-stack frame ID Date: Mon, 07 Mar 2016 11:19:57 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16030710-0033-0000-0000-0000062325C6 X-IsSubscribed: yes When determining the frame ID of an inline frame, GDB currently asserts that a valid ID of the underlying real frame is found, and that it does not match outer_frame_id. From inline_frame_this_id(): /* For now, require we don't match outer_frame_id either (see comment above). */ gdb_assert (!frame_id_eq (*this_id, outer_frame_id)); However, this assertion may fail when the real frame's unwinder can not determine the frame ID. This happened on an s390x target with a binary that lacked call frame information and also confused the prologue analyzer, because then s390_frame_this_id() left the frame ID at its default. To fix this, this change enhances s390_frame_this_id such that an unavailable-stack frame ID is built if no frame base can be determined but the function address is available. gdb/ChangeLog: * s390-linux-tdep.c (s390_prologue_frame_unwind_cache): Store frame func's PC in info->func before any other failure can occur. (s390_frame_this_id): Use frame_id_build_unavailable_stack if info->func has been filled out. --- gdb/s390-linux-tdep.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c index 7f860b6..155bc66 100644 --- a/gdb/s390-linux-tdep.c +++ b/gdb/s390-linux-tdep.c @@ -2011,9 +2011,12 @@ s390_prologue_frame_unwind_cache (struct frame_info *this_frame, bother searching for it -- with modern compilers this would be mostly pointless anyway. Trust that we'll either have valid DWARF-2 CFI data or else a valid backchain ... */ - func = get_frame_func (this_frame); - if (!func) - return 0; + if (!get_frame_func_if_available (this_frame, &info->func)) + { + info->func = -1; + return 0; + } + func = info->func; /* Try to analyze the prologue. */ result = s390_analyze_prologue (gdbarch, func, @@ -2167,7 +2170,6 @@ s390_prologue_frame_unwind_cache (struct frame_info *this_frame, info->local_base = prev_sp - size; } - info->func = func; return 1; } @@ -2267,7 +2269,11 @@ s390_frame_this_id (struct frame_info *this_frame, = s390_frame_unwind_cache (this_frame, this_prologue_cache); if (info->frame_base == -1) - return; + { + if (info->func != -1) + *this_id = frame_id_build_unavailable_stack (info->func); + return; + } *this_id = frame_id_build (info->frame_base, info->func); }