From: John Hodge Date: Fri, 22 Nov 2013 09:45:18 +0000 (+0800) Subject: Kernel - Working on allowing \0 out debug X-Git-Tag: rel0.15~78 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=ac32205b722276a0e7502e3ab003171f852341de;p=tpg%2Facess2.git Kernel - Working on allowing \0 out debug --- diff --git a/KernelLand/Kernel/libc.c b/KernelLand/Kernel/libc.c index c065e1ed..d42e5249 100644 --- a/KernelLand/Kernel/libc.c +++ b/KernelLand/Kernel/libc.c @@ -394,7 +394,13 @@ int vsnprintf(char *__s, const size_t __maxlen, const char *__format, va_list ar if( !CheckMem(p, minSize) ) continue; // No #PFs please if(!p) goto printString; while(minSize--) { - PUTCH(*p); + if(*p == '\0') { + PUTCH('\\'); + PUTCH('0'); + } + else { + PUTCH(*p); + } p ++; } break; diff --git a/KernelLand/Kernel/logging.c b/KernelLand/Kernel/logging.c index 5149e021..e0f20504 100644 --- a/KernelLand/Kernel/logging.c +++ b/KernelLand/Kernel/logging.c @@ -163,10 +163,11 @@ void Log_Int_PrintMessage(tLogEntry *Entry) csaLevelColours[Entry->Level], Entry->Time ); - LogF("%s [%-8s] %i - %s", + LogF("%s [%-8s] %i - %*C", csaLevelCodes[Entry->Level], Entry->Ident, Threads_GetTID(), + Entry->Length, Entry->Data ); LogF("\x1B[0m\r\n"); // Separate in case Entry->Data is too long diff --git a/KernelLand/Kernel/threads.c b/KernelLand/Kernel/threads.c index 1781f699..b2ce594f 100644 --- a/KernelLand/Kernel/threads.c +++ b/KernelLand/Kernel/threads.c @@ -505,6 +505,7 @@ tTID Threads_WaitTID(int TID, int *Status) // Specific Thread if(TID > 0) { + // TODO: Register on thread to be poked when it dies tTID ret; // NOTE: Race condition - Other child dies, desired child dies, first death is 'lost' while( (ret = Threads_WaitTID(-1, Status)) != TID )