[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).

svn path=/trunk/; revision=48479
This commit is contained in:
Sir Richard 2010-08-07 16:16:17 +00:00
parent 4adeefec39
commit c444de303a

View file

@ -350,9 +350,14 @@ KdpPrintString(LPSTR String,
{ {
PLIST_ENTRY CurrentEntry; PLIST_ENTRY CurrentEntry;
PKD_DISPATCH_TABLE CurrentTable; PKD_DISPATCH_TABLE CurrentTable;
CHAR Buffer[32];
if (!KdpDebugMode.Value) return 0; 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 */ /* Call the registered handlers */
CurrentEntry = KdProviders.Flink; CurrentEntry = KdProviders.Flink;
while (CurrentEntry != &KdProviders) while (CurrentEntry != &KdProviders)
@ -362,6 +367,9 @@ KdpPrintString(LPSTR String,
KD_DISPATCH_TABLE, KD_DISPATCH_TABLE,
KdProvidersList); KdProvidersList);
/* Send the process name */
CurrentTable->KdpPrintRoutine(Buffer, sizeof(Buffer));
/* Call it */ /* Call it */
CurrentTable->KdpPrintRoutine(String, Length); CurrentTable->KdpPrintRoutine(String, Length);
@ -371,7 +379,13 @@ KdpPrintString(LPSTR String,
/* Call the Wrapper Routine */ /* Call the Wrapper Routine */
if (WrapperTable.KdpPrintRoutine) if (WrapperTable.KdpPrintRoutine)
{
/* Send the process name */
WrapperTable.KdpPrintRoutine(Buffer, sizeof(Buffer));
/* Send the message */
WrapperTable.KdpPrintRoutine(String, Length); WrapperTable.KdpPrintRoutine(String, Length);
}
/* Return the Length */ /* Return the Length */
return Length; return Length;