Click here for a larger image.
Environment: C# .NET Framework 1.0
The first source of debug messages is the output debug stream and these messages are usually generated when a process calls OutputDebugString(); this is what ATLTRACE() does. These messages are available through a memory mapped file called DBWIN_BUFFER and access to this is managed through two events called DBWIN_BUFFER_READY and DBWIN_DATA_READY. The data in the memory mapped file is a string prefixed with the process ID of the process that generates the string. The code to access this memory mapped file is in the Platform SDK example.
TraceView is a debug utility that captures debug messages from shared memory DBWIN_BUFFER. It has following useful features:
- Trace selected processes—Delect multiple processes or all processes.
- Apply custom filters at run time—This can be used for class level tracing. If filter strings are provided, it looks for the first occurence of the filter string into a message and filters out messages.
- Log the messages to log file—Efficient way to log messages into a file. It dumps messages only after the number of new messages exceeds ViewCapacity.
- Level of tracing—All, Error, Warning, Info and Verbose. It looks for first occurence of these trace level strings into messages to filter out the messages.
- Multiple line messages are displayed in separate rows under the same process and time group.
- Persistent user settings—It serializes the application settings in .config file in user's path.