+debug_message (const char *file, int line, const char *function,
+ const char *class, const char *message, ...)
+{
+ if (class_is_enabled (class))
+ {
+ va_list args;
+
+#ifdef KERNEL
+ enum intr_level old_level = intr_disable ();
+#endif
+ printf ("%s:%d: %s(): ", file, line, function);
+ va_start (args, message);
+ vprintf (message, args);
+ printf ("\n");
+ va_end (args);
+#ifdef KERNEL
+ intr_set_level (old_level);
+#endif
+ }
+}
+
+/* Halts the OS or user program, printing the source file name,
+ line number, and function name, plus a user-specific
+ message. */
+void
+debug_panic (const char *file, int line, const char *function,
+ const char *message, ...)