Index: kernel/arch/abs32le/include/debug.h
===================================================================
--- kernel/arch/abs32le/include/debug.h	(revision 7de7cdecfd35be40f3afd79cf10c784b47fad3e9)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup abs32ledebug
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_DEBUG_H_
-#define KERN_abs32le_DEBUG_H_
-
-#include <arch/asm.h>
-
-#define HERE  get_ip()
-
-#endif
-
-/** @}
- */
Index: kernel/arch/amd64/include/debug.h
===================================================================
--- kernel/arch/amd64/include/debug.h	(revision 7de7cdecfd35be40f3afd79cf10c784b47fad3e9)
+++ 	(revision )
@@ -1,1 +1,0 @@
-../../ia32/include/debug.h
Index: kernel/arch/arm32/include/debug.h
===================================================================
--- kernel/arch/arm32/include/debug.h	(revision 7de7cdecfd35be40f3afd79cf10c784b47fad3e9)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/*
- * Copyright (c) 2005 Jakub Jermar 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup arm32debug
- * @{
- */
-/** @file
- *  @brief Empty.
- */
-
-#ifndef KERN_arm32_DEBUG_H_
-#define KERN_arm32_DEBUG_H_
-
-#endif
-
-/** @}
- */
Index: kernel/arch/ia32/include/debug.h
===================================================================
--- kernel/arch/ia32/include/debug.h	(revision 7de7cdecfd35be40f3afd79cf10c784b47fad3e9)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2005 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup amd64debug
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_ia32_DEBUG_H_
-#define KERN_ia32_DEBUG_H_
-
-#include <arch/asm.h>
-
-#define HERE get_ip()
-
-#endif
-
-/** @}
- */
Index: kernel/arch/ia64/include/debug.h
===================================================================
--- kernel/arch/ia64/include/debug.h	(revision 7de7cdecfd35be40f3afd79cf10c784b47fad3e9)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/*
- * Copyright (c) 2005 Ondrej Palkovsky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup ia64debug ia64
- * @ingroup debug
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_ia64_DEBUG_H_
-#define KERN_ia64_DEBUG_H_
-
-#endif
-
-/** @}
- */
Index: kernel/arch/ppc32/include/debug.h
===================================================================
--- kernel/arch/ppc32/include/debug.h	(revision 7de7cdecfd35be40f3afd79cf10c784b47fad3e9)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/*
- * Copyright (c) 2005 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup ppc32debug
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_ppc32_DEBUG_H_
-#define KERN_ppc32_DEBUG_H_
-
-#endif
-
-/** @}
- */
Index: kernel/arch/sparc64/include/debug.h
===================================================================
--- kernel/arch/sparc64/include/debug.h	(revision 7de7cdecfd35be40f3afd79cf10c784b47fad3e9)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/*
- * Copyright (c) 2005 Jakub Jermar 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup sparc64debug
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_sparc64_DEBUG_H_
-#define KERN_sparc64_DEBUG_H_
-
-#endif
-
-/** @}
- */
Index: kernel/generic/include/debug.h
===================================================================
--- kernel/generic/include/debug.h	(revision 7de7cdecfd35be40f3afd79cf10c784b47fad3e9)
+++ kernel/generic/include/debug.h	(revision 31198c1215c4e4a979a6f8e80df9c8c170c13886)
@@ -37,16 +37,7 @@
 
 #include <panic.h>
-#include <arch/debug.h>
+#include <symtab.h>
 
 #define CALLER  ((uintptr_t) __builtin_return_address(0))
-
-
-#ifndef HERE
-
-/** Current Instruction Pointer address */
-#define HERE ((uintptr_t *) 0)
-
-#endif /* HERE */
-
 
 #ifdef CONFIG_DEBUG
@@ -62,7 +53,8 @@
  */
 #define ASSERT(expr) \
-	if (!(expr)) { \
-		panic("Assertion failed (%s), caller=%p.", #expr, CALLER); \
-	}
+	do { \
+		if (!(expr)) \
+			panic("Assertion failed (%s)", #expr); \
+	} while (0)
 
 /** Debugging verbose ASSERT macro
@@ -78,7 +70,8 @@
  */
 #define ASSERT_VERBOSE(expr, msg) \
-	if (!(expr)) { \
-		panic("Assertion failed (%s, %s), caller=%p.", #expr, msg, CALLER); \
-	}
+	do { \
+		if (!(expr)) \
+			panic("Assertion failed (%s, %s)", #expr, msg); \
+	} while (0)
 
 #else /* CONFIG_DEBUG */
@@ -88,5 +81,4 @@
 
 #endif /* CONFIG_DEBUG */
-
 
 #ifdef CONFIG_LOG
@@ -100,6 +92,8 @@
  */
 #define LOG(format, ...) \
-	printf("%s() at %s:%u: " format "\n", __func__, __FILE__, \
-	    __LINE__, ##__VA_ARGS__);
+	do { \
+		printf("%s->%s() at %s:%u: " format "\n", symtab_fmt_name_lookup(CALLER), \
+		    __func__, __FILE__, __LINE__, ##__VA_ARGS__); \
+	} while (0)
 
 /** Extensive logging execute macro
@@ -111,14 +105,14 @@
  */
 #define LOG_EXEC(fnc) \
-	{ \
-		printf("%s() at %s:%u: " #fnc "\n", __func__, __FILE__, \
-		    __LINE__); \
+	do { \
+		printf("%s->%s() at %s:%u: " #fnc "\n", symtab_fmt_name_lookup(CALLER), \
+		    __func__, __FILE__, __LINE__); \
 		fnc; \
-	}
-	
-#else /* CONFOG_LOG */
+	} while (0)
+
+#else /* CONFIG_LOG */
 
 #define LOG(format, ...)
-#define LOG_EXEC(fnc) fnc
+#define LOG_EXEC(fnc)     fnc
 
 #endif /* CONFOG_LOG */
Index: kernel/generic/include/panic.h
===================================================================
--- kernel/generic/include/panic.h	(revision 7de7cdecfd35be40f3afd79cf10c784b47fad3e9)
+++ kernel/generic/include/panic.h	(revision 31198c1215c4e4a979a6f8e80df9c8c170c13886)
@@ -41,20 +41,25 @@
 
 #ifdef CONFIG_DEBUG
-#	define panic(format, ...) \
-		do { \
-			silent = false; \
-			printf("Kernel panic in %s() at %s:%u.\n", \
-			    __func__, __FILE__, __LINE__); \
-			stack_trace(); \
-			panic_printf("Panic message: " format "\n", \
-			    ##__VA_ARGS__);\
-		} while (0)
-#else
-#	define panic(format, ...) \
-		do { \
-			silent = false; \
-			panic_printf("Kernel panic: " format "\n", ##__VA_ARGS__); \
-		} while (0)
-#endif
+
+#define panic(format, ...) \
+	do { \
+		silent = false; \
+		printf("Kernel panic in %s() at %s:%u\n", \
+		    __func__, __FILE__, __LINE__); \
+		stack_trace(); \
+		panic_printf("Panic message: " format "\n", \
+		    ##__VA_ARGS__);\
+	} while (0)
+
+#else /* CONFIG_DEBUG */
+
+#define panic(format, ...) \
+	do { \
+		silent = false; \
+		panic_printf("Kernel panic: " format "\n", ##__VA_ARGS__); \
+		stack_trace(); \
+	} while (0)
+
+#endif /* CONFIG_DEBUG */
 
 extern bool silent;
