#ifndef __DEBUG_H
#define __DEBUG_H

#include <assert.h>
#include <platform/debug.h>

#define panic(x...) { dprintf("panic: " x); debug_halt(); }

#define PANIC_UNIMPLEMENTED panic("%s unimplemented\n", __PRETTY_FUNCTION__)

#define TRACE_ENTRY dprintf("%s: entry\n", __PRETTY_FUNCTION__)
#define TRACE_EXIT dprintf("%s: exit\n", __PRETTY_FUNCTION__)
#define TRACE_ENTRY_OBJ dprintf("%s: entry obj %p\n", __PRETTY_FUNCTION__, this)
#define TRACE_EXIT_OBJ dprintf("%s: exit obj %p\n", __PRETTY_FUNCTION__, this)
#define TRACE dprintf("%s: line %d\n", __PRETTY_FUNCTION__, __LINE__)

#endif
