From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31450 invoked by alias); 13 Dec 2013 18:27:38 -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 31438 invoked by uid 89); 13 Dec 2013 18:27:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 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 ESMTP; Fri, 13 Dec 2013 18:27:37 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBDIRYog022033 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 13 Dec 2013 13:27:34 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBDIRWgq004675; Fri, 13 Dec 2013 13:27:33 -0500 Message-ID: <52AB5194.2050205@redhat.com> Date: Fri, 13 Dec 2013 18:27:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Markus Metzger CC: jan.kratochvil@redhat.com, gdb-patches@sourceware.org Subject: Re: [patch v8 15/24] frame, backtrace: allow targets to supply a frame unwinder References: <1386839747-8860-1-git-send-email-markus.t.metzger@intel.com> <1386839747-8860-16-git-send-email-markus.t.metzger@intel.com> In-Reply-To: <1386839747-8860-16-git-send-email-markus.t.metzger@intel.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-12/txt/msg00538.txt.bz2 On 12/12/2013 09:15 AM, Markus Metzger wrote: > Allow targets to supply their own target-specific frame unwinders; one for > normal frames and one for tailcall frames. If a target-specific unwinder > is supplied, it will be chosen before any other unwinder. These ... > > diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c > index c4f8771..4efa7d8 100644 > --- a/gdb/dwarf2-frame.c > +++ b/gdb/dwarf2-frame.c > @@ -1513,16 +1513,16 @@ dwarf2_frame_cfa (struct frame_info *this_frame) > { > while (get_frame_type (this_frame) == INLINE_FRAME) > this_frame = get_prev_frame (this_frame); > + if (get_frame_unwind_stop_reason (this_frame) == UNWIND_UNAVAILABLE) > + throw_error (NOT_AVAILABLE_ERROR, > + _("can't compute CFA for this frame: " > + "required registers or memory are unavailable")); > /* This restriction could be lifted if other unwinders are known to > compute the frame base in a way compatible with the DWARF > unwinder. */ > if (!frame_unwinder_is (this_frame, &dwarf2_frame_unwind) > && !frame_unwinder_is (this_frame, &dwarf2_tailcall_frame_unwind)) > error (_("can't compute CFA for this frame")); > - if (get_frame_unwind_stop_reason (this_frame) == UNWIND_UNAVAILABLE) > - throw_error (NOT_AVAILABLE_ERROR, > - _("can't compute CFA for this frame: " > - "required registers or memory are unavailable")); > return get_frame_base (this_frame); > } > diff --git a/gdb/frame.c b/gdb/frame.c > index 37d780e..3f2aabb 100644 > --- a/gdb/frame.c > +++ b/gdb/frame.c > @@ -2507,13 +2507,10 @@ get_frame_sp (struct frame_info *this_frame) > enum unwind_stop_reason > get_frame_unwind_stop_reason (struct frame_info *frame) > { > - /* If we haven't tried to unwind past this point yet, then assume > - that unwinding would succeed. */ > - if (frame->prev_p == 0) > - return UNWIND_NO_REASON; > + /* Fill-in STOP_REASON. */ > + get_prev_frame_1 (frame); > + gdb_assert (frame->prev_p); > > - /* Otherwise, we set a reason when we succeeded (or failed) to > - unwind. */ > return frame->stop_reason; > } ... parts look a bit unrelated. It'd be good to have the rationale for this spelled out. I can understand why they might be necessary, but I don't see why target vs non-unwinders unwinders would be special here? -- Pedro Alves