From 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 27 Mar 2012 11:51:08 +0200 Subject: reorganize file structure to match the upstream requirements --- pintos-progos/lib/debug.h | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 pintos-progos/lib/debug.h (limited to 'pintos-progos/lib/debug.h') diff --git a/pintos-progos/lib/debug.h b/pintos-progos/lib/debug.h deleted file mode 100644 index 888ab7b..0000000 --- a/pintos-progos/lib/debug.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __LIB_DEBUG_H -#define __LIB_DEBUG_H - -/* GCC lets us add "attributes" to functions, function - parameters, etc. to indicate their properties. - See the GCC manual for details. */ -#define UNUSED __attribute__ ((unused)) -#define NO_RETURN __attribute__ ((noreturn)) -#define NO_INLINE __attribute__ ((noinline)) -#define PRINTF_FORMAT(FMT, FIRST) __attribute__ ((format (printf, FMT, FIRST))) - -/* Halts the OS, printing the source file name, line number, and - function name, plus a user-specific message. */ -#define PANIC(...) debug_panic (__FILE__, __LINE__, __func__, __VA_ARGS__) - -void debug_panic (const char *file, int line, const char *function, - const char *message, ...) PRINTF_FORMAT (4, 5) NO_RETURN; -void debug_backtrace (void); -void debug_backtrace_all (void); - -#endif - - - -/* This is outside the header guard so that debug.h may be - included multiple times with different settings of NDEBUG. */ -#undef ASSERT -#undef NOT_REACHED - -#ifndef NDEBUG -#define ASSERT(CONDITION) \ - if (CONDITION) { } else { \ - PANIC ("assertion `%s' failed.", #CONDITION); \ - } -#define NOT_REACHED() PANIC ("executed an unreachable statement"); -#else -#define ASSERT(CONDITION) ((void) 0) -#define NOT_REACHED() for (;;) -#endif /* lib/debug.h */ -- cgit v1.2.3