Date: Tue, 27 Jun 2000 11:59:41 +0100 (BST) From: Nick Hibma <n_hibma@calcaphon.com> To: Warner Losh <imp@village.org> Cc: new-bus@FreeBSD.ORG Subject: Re: Debugger vs panic Message-ID: <Pine.BSF.4.20.0006271149030.13143-100000@localhost> In-Reply-To: <200006270322.VAA30153@harmony.village.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.20.0006271149030.13143-100000>