From owner-freebsd-new-bus Tue Jun 27 4: 6: 7 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by hub.freebsd.org (Postfix) with ESMTP id 77B6537BF6B for ; Tue, 27 Jun 2000 04:05:55 -0700 (PDT) (envelope-from n_hibma@qubesoft.com) Received: from calcaphon.demon.co.uk ([193.237.19.5] helo=bluebottle.qubesoft.com) by anchor-post-34.mail.demon.net with esmtp (Exim 2.12 #1) id 136tBf-000Eal-0Y; Tue, 27 Jun 2000 12:05:51 +0100 Received: from henny.webweaving.org (henny.qubesoft.com [192.168.1.5]) by bluebottle.qubesoft.com (8.9.3/8.9.1) with ESMTP id MAA41881; Tue, 27 Jun 2000 12:07:33 +0100 (BST) (envelope-from n_hibma@qubesoft.com) Received: from localhost (localhost [127.0.0.1]) by henny.webweaving.org (8.9.3/8.9.3) with ESMTP id LAA13243; Tue, 27 Jun 2000 11:59:41 +0100 (BST) (envelope-from n_hibma@qubesoft.com) Date: Tue, 27 Jun 2000 11:59:41 +0100 (BST) From: Nick Hibma X-Sender: n_hibma@localhost Reply-To: Nick Hibma To: Warner Losh Cc: new-bus@FreeBSD.ORG Subject: Re: Debugger vs panic In-Reply-To: <200006270322.VAA30153@harmony.village.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I've made this exact same comment to dfr about 1.5 years ago, to replace the panics with appropriate empty returns, returning NULL or false in most cases. He was quite persistent in his opinion that it was a bug in the code and could only lead to faults later in the code. He'd rather have the problem pointed out right where it occurs. And I agree with him to the extent that if there is a problem it should go pop as early as possible in the appropriate place, and not at a later stage where you will have to trace back to the place where the value was last written, which might be complicated to say the least. However, this also means that you will have to do more checking in your code before you call any function, eventhough the error value might sufficient (for example calling device_busy before the device is attached). One of the reasons I like Perl is that it allows you to make mistakes and fix them up later in the code. Nick > There's lots of places in newbus that programming errors trigger a > panic. This can make it very difficult to debug the probe/attach > routines. Is there any way that this can just dump you into the > debugger and then return out failing the call? > > Warner > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-new-bus" in the body of the message > -- n_hibma@webweaving.org n_hibma@freebsd.org USB project http://www.etla.net/~n_hibma/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message