Kernel - Working on allowing \0 out debug
authorJohn Hodge <[email protected]>
Fri, 22 Nov 2013 09:45:18 +0000 (17:45 +0800)
committerJohn Hodge <[email protected]>
Fri, 22 Nov 2013 09:45:18 +0000 (17:45 +0800)
KernelLand/Kernel/libc.c
KernelLand/Kernel/logging.c
KernelLand/Kernel/threads.c

index c065e1e..d42e524 100644 (file)
@@ -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;
index 5149e02..e0f2050 100644 (file)
@@ -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
index 1781f69..b2ce594 100644 (file)
@@ -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 )

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