From owner-freebsd-current@FreeBSD.ORG Thu Sep 17 12:08:36 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6666A106566C for ; Thu, 17 Sep 2009 12:08:36 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from itchy.rabson.org (router.rabson.org [80.177.232.241]) by mx1.freebsd.org (Postfix) with ESMTP id 619198FC1E for ; Thu, 17 Sep 2009 12:08:35 +0000 (UTC) Received: from [192.168.42.48] (unknown [192.168.42.48]) by itchy.rabson.org (Postfix) with ESMTP id ED50C5CC8; Thu, 17 Sep 2009 13:08:05 +0100 (BST) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Doug Rabson In-Reply-To: Date: Thu, 17 Sep 2009 13:03:40 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: To: Andrew Cagney X-Mailer: Apple Mail (2.1076) Cc: freebsd-current@freebsd.org Subject: Re: New BSD licensed debugger X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 12:08:36 -0000 On 16 Sep 2009, at 21:37, Andrew Cagney wrote: > Wicked; the location code, in particular, is sick. As you've noticed, > this isn't rocket science; and good language choice does make life > easier. Indeed. > > Several things to consider. > > Rather than frame-base, I'd use CFA or call-frame-address found in > .debug_frame or CFI when identifying frames (and determining if the > frame changed such as for step). In addition, since frameless > functions don't modify the CFA (they don't use the stack) you'll want > to be combining it with the function's address giving a > FrameIdentifier I will probably switch to using CFA for identifying stack frames. LLVM produces useless values for AT_frame_base - it really needs to generate a location list rather than just saying 'EBP'. > (oh, and IA-64 has two stacks so ... :-) I know it. I did the FreeBSD/ia64 port and it was fun :) > > The unwinder looks to be trying to simultaneously handle both > high-level inline and low-level ABI (CFA) frames, an alternative > approach is to keep them separate (decorator pattern works well here) > having an abi-only chain and then above that a chain of higher-level > possibly inline frames. I have to think about that. Unwinding inlines was added fairly recently and I'm certainly open to suggestions for making it more useful. > > A non-polling implementation would make a long term goal - which > requires a mechanism for simultaneously blocking on both process and > i/o events - on linux, at least, this is still a rats nest of bugs. I think some kind of async implementation will be useful down the line too, especially if anyone wants to write a GUI on top of this stuff.