From 2c9822ab13554ffab9f634a839ee916e0388179c Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 25 Sep 2009 20:12:21 +0800 Subject: [PATCH] Turned on debug in syscalls and added return address to free's warning --- Kernel/heap.c | 4 ++-- Kernel/syscalls.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel/heap.c b/Kernel/heap.c index fbff88b2..79f5f404 100644 --- a/Kernel/heap.c +++ b/Kernel/heap.c @@ -251,7 +251,7 @@ void free(void *Ptr) // Alignment Check if( (Uint)Ptr & (sizeof(Uint)-1) ) { - Warning("free - Passed a non-aligned address (%p)\n", Ptr); + Warning("free - Passed a non-aligned address (%p)", Ptr); return; } @@ -265,7 +265,7 @@ void free(void *Ptr) // Check memory block - Header head = (void*)( (Uint)Ptr - sizeof(tHeapHead) ); if(head->Magic == MAGIC_FREE) { - Warning("free - Passed a freed block (%p)\n", head); + Warning("free - Passed a freed block (%p) by %p", head, __builtin_return_address(0)); return; } if(head->Magic != MAGIC_USED) { diff --git a/Kernel/syscalls.c b/Kernel/syscalls.c index 8790be76..90422cee 100644 --- a/Kernel/syscalls.c +++ b/Kernel/syscalls.c @@ -2,7 +2,7 @@ * AcessOS Microkernel Version * syscalls.c */ -#define DEBUG 0 +#define DEBUG 1 #include #include @@ -29,7 +29,7 @@ void SyscallHandler(tSyscallRegs *Regs) Uint64 ret = 0; Uint err = 0; #if DEBUG - ENTER("iThread iNum", gCurrentThread->TID, Regs->Num); + ENTER("iThread iNum", Threads_GetTID(), Regs->Num); if(Regs->Num < NUM_SYSCALLS) LOG("Syscall %s", cSYSCALL_NAMES[Regs->Num]); LOG("Arg1: 0x%x, Arg2: 0x%x, Arg3: 0x%x", Regs->Arg1, Regs->Arg2, Regs->Arg3); -- 2.20.1