From: John Hodge Date: Fri, 25 Sep 2009 12:12:21 +0000 (+0800) Subject: Turned on debug in syscalls and added return address to free's warning X-Git-Tag: rel0.06~508 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=2c9822ab13554ffab9f634a839ee916e0388179c;p=tpg%2Facess2.git Turned on debug in syscalls and added return address to free's warning --- 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);