From b519c413b534ab831a0fcb6228b8a49d4a491279 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 4 Jul 2012 22:21:41 +0800 Subject: [PATCH] AcessNative - Cleaning up debug --- AcessNative/RunTest | 3 ++- AcessNative/acesskernel_src/server.c | 8 +++++--- AcessNative/acesskernel_src/syscalls.c | 2 +- AcessNative/acesskernel_src/threads.c | 3 --- AcessNative/ld-acess_src/binary.c | 11 ++++++++--- AcessNative/ld-acess_src/elf_load.c | 2 +- AcessNative/ld-acess_src/exports.c | 6 +++--- AcessNative/ld-acess_src/memory.c | 2 +- 8 files changed, 21 insertions(+), 16 deletions(-) diff --git a/AcessNative/RunTest b/AcessNative/RunTest index 3a2a3a21..6ea88b67 100755 --- a/AcessNative/RunTest +++ b/AcessNative/RunTest @@ -1,5 +1,6 @@ #!/bin/sh trap '' 2 -$1 ./AcessKernel --rootapp /Acess/SBin/login +#$1 ./AcessKernel --rootapp /Acess/SBin/login +$1 ./AcessKernel --rootapp /Acess/Apps/AxWin/3.0/AxWinWM trap 2 killall ld-acess diff --git a/AcessNative/acesskernel_src/server.c b/AcessNative/acesskernel_src/server.c index b9b2b19b..78f7fa13 100644 --- a/AcessNative/acesskernel_src/server.c +++ b/AcessNative/acesskernel_src/server.c @@ -131,9 +131,11 @@ int Server_WorkerThread(void *ClientPtr) while( Client->CurrentRequest == NULL ) SDL_CondWait(Client->WaitFlag, Client->Mutex); - Log_Debug("AcessSrv", "Worker got message %p", Client->CurrentRequest); +// Log_Debug("AcessSrv", "Worker got message %p", Client->CurrentRequest); if(Client->ClientID != cur_client_id) { +// Log_Debug("AcessSrv", "Client thread ID changed from %i to %i", +// cur_client_id, Client->ClientID); Threads_SetThread( Client->ClientID ); cur_client_id = Client->ClientID; } @@ -304,8 +306,8 @@ int Server_ListenThread(void *Unused) continue; } - Log_Debug("AcessSrv", "Message from Client %i (%p)", - client->ClientID, client); +// Log_Debug("AcessSrv", "Message from Client %i (%p)", +// client->ClientID, client); // Make a copy of the request data req = malloc(length); diff --git a/AcessNative/acesskernel_src/syscalls.c b/AcessNative/acesskernel_src/syscalls.c index b945df81..9b9fda42 100644 --- a/AcessNative/acesskernel_src/syscalls.c +++ b/AcessNative/acesskernel_src/syscalls.c @@ -4,7 +4,7 @@ * * Syscall Distribution */ -#define DEBUG 1 +#define DEBUG 0 #include #include #include diff --git a/AcessNative/acesskernel_src/threads.c b/AcessNative/acesskernel_src/threads.c index 778917ce..c390a031 100644 --- a/AcessNative/acesskernel_src/threads.c +++ b/AcessNative/acesskernel_src/threads.c @@ -97,12 +97,9 @@ void Threads_SetThread(int TID) tThread *Threads_GetThread(Uint TID) { tThread *thread; - Log_Debug("Threads", "Looking for TID %i", TID); for( thread = gpThreads; thread; thread = thread->GlobalNext ) { if( thread->TID == TID ) { - Log_Debug("Threads", "Found %p", thread); - Log_Debug("Threads", "- Name = %s", thread->ThreadName); return thread; } } diff --git a/AcessNative/ld-acess_src/binary.c b/AcessNative/ld-acess_src/binary.c index 8d11e975..d04ac6d2 100644 --- a/AcessNative/ld-acess_src/binary.c +++ b/AcessNative/ld-acess_src/binary.c @@ -1,7 +1,11 @@ /* - * AcessNative + * AcessNative Dynamic Linker + * - By John Hodge (thePowersGang) + * + * binary.c + * - Provides binary loading and type abstraction */ -#define DEBUG 1 +#define DEBUG 0 #include "common.h" #include #include @@ -110,7 +114,8 @@ void *Binary_LoadLibrary(const char *Name) } ret = Binary_Load(path, (uintptr_t*)&entry); - printf("LOADED '%s' to %p (Entry=%p)\n", path, ret, entry); + if( ret != (void*)-1 ) + Debug("LOADED '%s' to %p (Entry=%p)", path, ret, entry); free(path); #if DEBUG diff --git a/AcessNative/ld-acess_src/elf_load.c b/AcessNative/ld-acess_src/elf_load.c index 8cafc01e..909c24a2 100644 --- a/AcessNative/ld-acess_src/elf_load.c +++ b/AcessNative/ld-acess_src/elf_load.c @@ -3,7 +3,7 @@ * * ELF Executable Loader Code */ -#define DEBUG 1 +#define DEBUG 0 #include #include #include diff --git a/AcessNative/ld-acess_src/exports.c b/AcessNative/ld-acess_src/exports.c index 957a86e5..fc336c8e 100644 --- a/AcessNative/ld-acess_src/exports.c +++ b/AcessNative/ld-acess_src/exports.c @@ -68,7 +68,7 @@ int acess_reopen(int FD, const char *Path, int Flags) { size_t acess_read(int FD, void *Dest, size_t Bytes) { if(FD & NATIVE_FILE_MASK) return native_read(FD & (NATIVE_FILE_MASK-1), Dest, Bytes); - if( FD > 2 ) +// if( FD > 2 ) DEBUG("read(0x%x, 0x%x, *%p)", FD, Bytes, Dest); return _Syscall(SYS_READ, ">i >i 2 ) +// if( FD > 2 ) DEBUG("write(0x%x, 0x%x, %p\"%.*s\")", FD, Bytes, Src, Bytes, (char*)Src); return _Syscall(SYS_WRITE, ">i >i >d", FD, Bytes, Bytes, Src); } @@ -287,7 +287,7 @@ void acess__SysDebug(const char *Format, ...) va_start(args, Format); - printf("[_SysDebug %i]", giSyscall_ClientID); + printf("[_SysDebug %i] ", giSyscall_ClientID); vprintf(Format, args); printf("\n"); diff --git a/AcessNative/ld-acess_src/memory.c b/AcessNative/ld-acess_src/memory.c index f1147c26..2e9612c3 100644 --- a/AcessNative/ld-acess_src/memory.c +++ b/AcessNative/ld-acess_src/memory.c @@ -53,7 +53,7 @@ uintptr_t FindFreeRange(size_t ByteCount, int MaxBits) end <<= (sizeof(intptr_t)*8-MaxBits); end >>= (sizeof(intptr_t)*8-MaxBits); - printf("end = %p\n", (void*)end); +// printf("end = %p\n", (void*)end); // for( base = 0; base < end - size; base -= PAGE_SIZE ) for( base = end - size + 1; base > 0; base -= PAGE_SIZE ) -- 2.20.1