From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20017 invoked by alias); 12 Jun 2007 09:23:56 -0000 Received: (qmail 20007 invoked by uid 22791); 12 Jun 2007 09:23:55 -0000 X-Spam-Check-By: sourceware.org Received: from mms2.broadcom.com (HELO mms2.broadcom.com) (216.31.210.18) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 12 Jun 2007 09:23:53 +0000 Received: from [10.10.64.154] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.1)); Tue, 12 Jun 2007 02:23:41 -0700 X-Server-Uuid: A6C4E0AE-A7F0-449F-BAE7-7FA0D737AC76 Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id 511162AF; Tue, 12 Jun 2007 02:23:41 -0700 (PDT) Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.10.64.221]) by mail-irva-10.broadcom.com (Postfix) with ESMTP id 3DF332AE for ; Tue, 12 Jun 2007 02:23:41 -0700 (PDT) Received: from mail-irva-12.broadcom.com (mail-irva-12.broadcom.com [10.10.64.146]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP id FJI98737; Tue, 12 Jun 2007 02:23:41 -0700 (PDT) Received: from NT-IRVA-0752.brcm.ad.broadcom.com ( nt-irva-0752.brcm.ad.broadcom.com [10.8.194.67]) by mail-irva-12.broadcom.com (Postfix) with ESMTP id 1335469CA3 for ; Tue, 12 Jun 2007 02:23:41 -0700 (PDT) Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: Target Dependent Backtrace Termination Date: Tue, 12 Jun 2007 09:23:00 -0000 Message-ID: From: "Robert Norton" To: gdb@sourceware.org X-WSS-ID: 6A70B9973CG8972953-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00087.txt.bz2 Hi, =20 Our target specifies in the ABI that frames should form a null terminated back chain something like: =20 Address Contents x: 0=20 ... \ Frame of thread's=20=20 y: x / entry function ... \ Frame of thread's z: y / level 1 function ... =20 So in principal it's not too hard for my target dependent code (i.e. unwind_this_id) to tell when a backtrace should not proceed any further. The problem I have is in trying to communicate this to the rest of GDB. My first approach was to detect when unwind_this_id is passed a next_frame which is the outermost frame and not return the frame_id in this case, indicating failure. Unfortunately this caused the backtrace to go one too far! Looking at some other ports it seems that the solution is to return the null frame id for the outermost frame thus causing get_prev_frame_1 to return null and terminating the backtrace. But this means that the outermost frame doesn't haven't a valid frame id! Won't this cause problems? Am I missing something rather fundamental? =20 =46rom what I can see all of the checks on frame validity in get_prev_frame* are performed on this_frame which, in the case of the outermost frame, is a valid frame and yet we want it to return null for the previous frame of the outermost frame. How can this work? Perhaps I am confused on the meanings of 'this', 'prev' and 'next' (though I thought I had this nailed down by now)? =20 Robert P.S. Sorry if this is a duplicate post, my last one didn't seem to get through.