Turned on debug in syscalls and added return address to free's warning
authorJohn Hodge <[email protected]>
Fri, 25 Sep 2009 12:12:21 +0000 (20:12 +0800)
committerJohn Hodge <[email protected]>
Fri, 25 Sep 2009 12:12:21 +0000 (20:12 +0800)
Kernel/heap.c
Kernel/syscalls.c

index fbff88b..79f5f40 100644 (file)
@@ -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) {
index 8790be7..90422ce 100644 (file)
@@ -2,7 +2,7 @@
  * AcessOS Microkernel Version
  * syscalls.c
  */
-#define DEBUG  0
+#define DEBUG  1
 
 #include <common.h>
 #include <syscalls.h>
@@ -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);

UCC git Repository :: git.ucc.asn.au