add more information to a failing assertion's panic message
authorAdam Hoka <adam.hoka@gmail.com>
Thu, 11 Aug 2011 16:52:59 +0000 (18:52 +0200)
committerVenkatesh Srinivas <me@endeavour.zapto.org>
Sun, 21 Aug 2011 00:22:57 +0000 (17:22 -0700)
Signed-off-by: Venkatesh Srinivas <me@endeavour.zapto.org>
sys/sys/systm.h

index b6f3735..6c5ec02 100644 (file)
@@ -105,9 +105,10 @@ extern vm_paddr_t Maxmem;  /* Highest physical memory address in system */
 #ifdef INVARIANTS              /* The option is always available */
 #define        KASSERT(exp,msg)        do { if (__predict_false(!(exp)))       \
                                        panic msg; } while (0)
-#define KKASSERT(exp)          do { if (__predict_false(!(exp)))       \
-                                       panic("assertion: %s in %s",    \
-                                             #exp, __func__); } while (0)
+#define KKASSERT(exp)          do { if (__predict_false(!(exp)))         \
+                                       panic("assertion \"%s\" failed "  \
+                                       "in %s at %s:%u", #exp, __func__, \
+                                       __FILE__, __LINE__); } while (0)
 #define __debugvar
 #else
 #define        KASSERT(exp,msg)