From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30656 invoked by alias); 22 Sep 2006 01:48:50 -0000 Received: (qmail 30407 invoked by uid 22791); 22 Sep 2006 01:48:50 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.palmsource.com (HELO mx2.palmsource.com) (12.7.175.14) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 22 Sep 2006 01:48:47 +0000 Received: from localhost (localhost [127.0.0.1]) by localhost.domain.tld (Postfix) with ESMTP id 188B526AF7; Thu, 21 Sep 2006 18:48:46 -0700 (PDT) Received: from mx2.palmsource.com ([127.0.0.1]) by localhost (mx2.palmsource.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 19438-01-3; Thu, 21 Sep 2006 18:48:45 -0700 (PDT) Received: from ussunex01.palmsource.com (unknown [192.168.101.9]) by mx2.palmsource.com (Postfix) with ESMTP id 3BAF526AE3; Thu, 21 Sep 2006 18:48:45 -0700 (PDT) Received: from 192.168.92.59 ([192.168.92.59]) by ussunex01.palmsource.com ([192.168.101.9]) via Exchange Front-End Server owa.palmsource.com ([10.0.20.17]) with Microsoft Exchange Server HTTP-DAV ; Fri, 22 Sep 2006 01:48:45 +0000 Received: from svmsnyderlnx by owa.palmsource.com; 21 Sep 2006 18:48:44 -0700 Subject: Infinite backtrace on (eg.) ARM From: Michael Snyder To: GDB Patches ML , Daniel Jacobowitz Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 22 Sep 2006 01:48:00 -0000 Message-Id: <1158889724.22863.41.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00137.txt.bz2 Been thinking about this problem. Check me out here. Taking a step or two back from the intimate view of gdb internals, the problem (if I understand it) is detecting the fact that we have an unusual case of a function that doesn't save it's return address. We have to detect the fact that we should stop the frame chain at this function's frame. So the most common case of a function that doesn't save its return address is a leaf function, yes? But we can distinguish that case from the pathological case by looking at the frame->level. A leaf function can only be at frame level zero, unles we've made a dummy frame on top of it via a target function call. So we can check for: * doesn't save its PC, and * frame->level > 0, and * frame->next is not a call dummy. Except that the information "doesn't save its PC" isn't public at the point where we want it. It's hidden within frame_register_unwind and below -- in this case, in trad_frame. So we sort of have a problem of "what do we know, and when do we know it". So -- what if we exported a method to make that info public? It's rather specific, but in this case important: "does this frame save its return address?"