X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fdebug.c;h=6132bd90226a1d858e2afc654bffe7500756531f;hb=547e8535ec9bd84f3508182618319155e69572f8;hp=dab20addce7204a1e43f852b1d582332e5ba520f;hpb=11dbd684e9a3d907d43d71a3145205f1a86992fb;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/debug.c b/KernelLand/Kernel/debug.c index dab20add..6132bd90 100644 --- a/KernelLand/Kernel/debug.c +++ b/KernelLand/Kernel/debug.c @@ -162,27 +162,47 @@ void Debug(const char *Fmt, ...) SHORTREL(&glDebug_Lock); #endif } -/** - * \fn void Log(const char *Msg, ...) - */ -void Log(const char *Fmt, ...) + + +void LogFV(const char *Fmt, va_list args) { - va_list args; + #if LOCK_DEBUG_OUTPUT + SHORTLOCK(&glDebug_Lock); + #endif + + Debug_Fmt(1, Fmt, args); + #if LOCK_DEBUG_OUTPUT + SHORTREL(&glDebug_Lock); + #endif +} + +void LogV(const char *Fmt, va_list args) +{ #if LOCK_DEBUG_OUTPUT SHORTLOCK(&glDebug_Lock); #endif Debug_Puts(1, "Log: "); - va_start(args, Fmt); Debug_Fmt(1, Fmt, args); - va_end(args); Debug_Puts(1, "\r\n"); #if LOCK_DEBUG_OUTPUT SHORTREL(&glDebug_Lock); #endif } + +/** + * \fn void Log(const char *Msg, ...) + */ +void Log(const char *Fmt, ...) +{ + va_list args; + va_start(args, Fmt); + LogV(Fmt, args); + va_end(args); +} + void Warning(const char *Fmt, ...) { va_list args; @@ -221,6 +241,7 @@ void Panic(const char *Fmt, ...) Debug_Putchar('\n'); Threads_Dump(); + Heap_Dump(); for(;;) ; } @@ -384,7 +405,7 @@ void Debug_Leave(const char *FuncName, char RetType, ...) #endif } -void Debug_HexDump(const char *Header, const void *Data, Uint Length) +void Debug_HexDump(const char *Header, const void *Data, size_t Length) { const Uint8 *cdat = Data; Uint pos = 0;