From owner-cvs-all Sat Oct 26 20:10:44 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5AC2C37B401; Sat, 26 Oct 2002 20:10:43 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id F1EAC43E3B; Sat, 26 Oct 2002 20:10:41 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id OAA21606; Sun, 27 Oct 2002 14:10:23 +1100 Date: Sun, 27 Oct 2002 14:21:38 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Dag-Erling Smorgrav Cc: Poul-Henning Kamp , John Baldwin , , Subject: Re: cvs commit: src/sys/kern kern_mutex.c In-Reply-To: Message-ID: <20021027141325.U10013-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 26 Oct 2002, Dag-Erling Smorgrav wrote: > Bruce Evans writes: > > No need. Memory access errors are very easy to debug since debuggers show > > a context with the precise instruction and function that caused the error. > > Anyone how can debug them doesn't need a hint about why the function might > > cause a memory access error. Panics are not so easy to debug, since the > > context and restartability are messed up by calling panic(). > > Maybe the KASSERT macros could be rewritten to cause a trap rather > than call panic(), to avoid messing up the stack frame? > > #define KASSERT(exp,msg) \ > do { if (!(exp)) panic_hint msg; *(int *)NULL = 0; } while (0) > > panic_hint() would be a short wrapper for vsnprintf(). Yes, though I would be tempted to optionally leave out the panic_hint part. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message