Author: sir_richard Date: Sat Aug 7 16:16:17 2010 New Revision: 48479
URL: http://svn.reactos.org/svn/reactos?rev=48479&view=rev Log: [NTOS]: Aleksey wants an easy way to see debug messages coming from one process vs. another, which is an obvious idea that should've done a long time ago. Now you can see who is generating a given debug message (including the thread).
Modified: trunk/reactos/ntoskrnl/kd/kdio.c
Modified: trunk/reactos/ntoskrnl/kd/kdio.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/kdio.c?rev=4847... ============================================================================== --- trunk/reactos/ntoskrnl/kd/kdio.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kd/kdio.c [iso-8859-1] Sat Aug 7 16:16:17 2010 @@ -350,8 +350,13 @@ { PLIST_ENTRY CurrentEntry; PKD_DISPATCH_TABLE CurrentTable; - + CHAR Buffer[32]; if (!KdpDebugMode.Value) return 0; + + /* Build process name and PID/TID buffer */ + sprintf(Buffer, "[%s (%p:%p)]: ", + PsGetCurrentProcess()->ImageFileName, + PsGetCurrentProcessId(), PsGetCurrentThreadId());
/* Call the registered handlers */ CurrentEntry = KdProviders.Flink; @@ -361,6 +366,9 @@ CurrentTable = CONTAINING_RECORD(CurrentEntry, KD_DISPATCH_TABLE, KdProvidersList); + + /* Send the process name */ + CurrentTable->KdpPrintRoutine(Buffer, sizeof(Buffer));
/* Call it */ CurrentTable->KdpPrintRoutine(String, Length); @@ -371,7 +379,13 @@
/* Call the Wrapper Routine */ if (WrapperTable.KdpPrintRoutine) + { + /* Send the process name */ + WrapperTable.KdpPrintRoutine(Buffer, sizeof(Buffer)); + + /* Send the message */ WrapperTable.KdpPrintRoutine(String, Length); + }
/* Return the Length */ return Length;