aboutsummaryrefslogtreecommitdiff
path: root/kern/assert.h
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2016-10-01 13:25:22 +0200
committerJustus Winter <justus@gnupg.org>2016-10-01 15:51:26 +0200
commitf025f685e965ac9ee1cd35ff3636c8554d9939d2 (patch)
treedc5126b12ed850de99875272f112d0e2b0a11243 /kern/assert.h
parentc81df8d61ed024b253334076041917b2c8fcf55e (diff)
downloadgnumach-f025f685e965ac9ee1cd35ff3636c8554d9939d2.tar.gz
gnumach-f025f685e965ac9ee1cd35ff3636c8554d9939d2.tar.bz2
gnumach-f025f685e965ac9ee1cd35ff3636c8554d9939d2.zip
kern: Improve assertions and panics.
* kern/assert.h (Assert): Add function argument. (assert): Supply function argument. * kern/debug.c (Assert): Add function argument. Unify message format. (panic): Rename to 'Panic', add location information. * kern/debug.h (panic): Rename, and add a macro version that supplies the location. * linux/dev/include/linux/kernel.h: Use the new panic macro.
Diffstat (limited to 'kern/assert.h')
-rw-r--r--kern/assert.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/kern/assert.h b/kern/assert.h
index 7b66d1b1..73e2a176 100644
--- a/kern/assert.h
+++ b/kern/assert.h
@@ -36,12 +36,13 @@
#endif
#if MACH_ASSERT
-extern void Assert(const char *exp, const char *filename, int line) __attribute__ ((noreturn));
+extern void Assert(const char *exp, const char *filename, int line,
+ const char *fun) __attribute__ ((noreturn));
#define assert(ex) \
((ex) \
? (void) (0) \
- : Assert (#ex, __FILE__, __LINE__))
+ : Assert (#ex, __FILE__, __LINE__, __FUNCTION__))
#define assert_static(x) assert(x)