42_KFS/headers/debug.h

30 lines
947 B
C
Raw Normal View History

#pragma once
2024-10-18 08:45:37 -04:00
#include "kpanic.h"
#include "kprintf.h"
#include <stdint.h>
#define PRINT_PTR(X) kprintf("%s:%u %s: %p\n", __FILE__, __LINE__, #X, X)
#define PRINT_STR(X) kprintf("%s:%u %s: %s\n", __FILE__, __LINE__, #X, X)
#define PRINT_UINT(X) kprintf("%s:%u %s: %u\n", __FILE__, __LINE__, #X, X)
#define PRINT_INT(X) kprintf("%s:%u %s: %d\n", __FILE__, __LINE__, #X, X)
2024-10-18 08:45:37 -04:00
#define assert(X) \
do { \
if (!(X)) { \
kpanic("ASSERT_FAIL %s:%u %s\n", __FILE__, __LINE__, \
#X); \
} \
} while (0)
struct function_entry {
uint32_t addr;
char name[64];
};
struct stackframe {
struct stackframe *ebp;
uint32_t eip;
};
2024-09-22 03:54:56 -04:00
void print_stack(void);