The information in this article applies to:
SUMMARYThis article provides detailed information on how to set up Windows NT Symbol Trees, as well as advanced setup tips and tricks. MORE INFORMATION
Article Contents
General InformationDebug Symbol files (symbols) are required to do both kernel and user-mode debugging in Windows NT. Symbols provide a way to reference global variables and function names in the loaded executable.Symbols are produced by the linker. They are stripped out of retail product and saved in a separate (.DBG) file. This considerably reduces file size which decreases file load time and thus increases system performance. It also reduces the number of install floppies. Symbols represent Function/API names and global variables. The .DBG File contains symbolic information for each file. They can be found on the installation CD-ROM in \SUPPORT\DEBUG\[i386 | mips]\SYMBOLS. They can also be found on the NT build server. The location is \\ntbuilds\release\usa\BUILD###\[x86 | mips |alpha]\fre.srv\symbols. The SYMBOLS directory is divided up into 7 subdirectories, called Extension Subdirectories (note that many of the symbol files in these directories are USER MODE): COM - symbols for all files ending in .COM go here Symbols must match file versions: Symbols from a different build give erroneous information and send developers chasing shadows and waste considerable time. Double check with the customer what build he is running and if he has any patches installed. The Kernel Stop Screen displays the build number of the kernel. Patched Builds: Patched builds such as Service Packs require a special set of symbols, that is a combination of the base build and the patched symbols. Setting Up Custom Symbol TreesRemember that symbols must match the files installed on a customer's computer. You often have to create a custom set of symbols just for a particular customer.NOTE: Complete Symbol Trees can take up over 30 MB of disk space!
Single Processor vs. Multi ProcessorWindows NT uses a special kernel for SMP systems. During installation this kernel is renamed. It is important that you also rename the SYMBOL.DBG file for debugging.NTOSKRNL.EXE NTOSKRNL.DBG = Single processor NTKRNLMP.EXE. NTKRNLMP.DBG = Multiple processors
Custom HAL.DLLSome hardware platforms require a special Hardware Abstraction Layer Driver. Like the Kernel file, the custom HAL is renamed during the installation process. Here is a list of common HALs:HAL files for I386 Computers:
How to Determine Which HAL to Use: During installation a text log file is created. This file will tell you tell you the original name of the HAL.
Go to Setup HAL Symbol:
Using Symbols in the DebuggerA Windows NT Debugger, such as I386KD.EXE, looks for symbols in the following locations:_NT_ALT_SYMBOL_PATH system environment variable These locations are set via system environment variables. They are usually configured by a debug batch file using the SET command. The _NT_ALT_SYMBOL_PATH is optional. For example: set _NT_SYMBOL_PATH=K:\NT35-SP3\SYMBOLS NOTE: The symbols directory is the directory directly above the extension subdirectories (that is, if the kernel symbol file, NTOSKRNL.DBG, is located at C:\DEBUG\511\I386\SYMBOLS\EXE\NTOSKRNL.DBG. The _NT_SYMBOL_PATH should be set to C:\DEBUG\511\I386\SYMBOLS How to Use Paths: A good use of these various paths is for keeping static symbol trees for each Windows NT version. You simply point your symbol paths to each version and Service Pack as needed. For example, for a 1057 system with SP2 installed you could use the following: set _NT_ALT_SYMBOL_PATH=c:\NT351-SP2\SYMBOLS The debugger attempts to use the Service Pack symbols first. [The Service Pack symbols do not include the base build symbols in this case - only the SP symbols.] If the debugger does not find a particular symbol in the SP tree it will look in the 1057 symbol tree. Search Order: The various symbol paths are searched in the order listed above. The first symbol file with the correct name that is encountered will be used. In the example above, _NT_ALT_SYMBOL_PATH=c:\NT351-SP2\SYMBOLS is the first one searched. Environment Variable Override: I386KD supports a command line switch "-y" where you can specify a symbol path. However, using this switch will override your existing environment variables. Change Path on the Fly: You can change the symbol search path at any time in the debugger by issuing "!Sympath" command. For example: !SYMPATH C:\SYMBOLS. Verifying the Symbols!RELOAD:Once you have gotten to the "kd>" prompt for the first time, you MUST type "!RELOAD". This causes the symbolic information to be reloaded and synchronized. If you get the error "PsLoadedModuleList is NULL!", then you probably have the wrong symbols loaded. Be sure you have the correct HAL.DBG and NTOSKRNL.DBG file installed for the machine that you are debugging. !PROCESS: Symbols can also be verified by typing "!PROCESS" if you get the error, "Can't find process list head", then you probably have the wrong symbols loaded. KB: If the Stack Trace has gaps in the function name list this indicates that you are missing symbols. Missing functions could also indicate a corrupt stack but this is somewhat rare. Double check your symbols before declaring a corrupt stack. Also, look at the return addresses on the stack. They should all be greater than 8000000. !SYMPATH: Incorrect symbols can be corrected by going to another command window, copying the correct symbols and doing a !reload on the debugger or by specifying the correct path with !SYMPATH <symbol_path>. Advanced Symbol VerificationSometimes customers do not know what driver versions they have installed on their computers. Perhaps they installed a hotfix for NTFS but they don't know which bug number. You may need to manually determine which .DBG files are needed.The best way to absolutely verify if target and dbg's match is to view their check sum value. This value is stored inside the file header. Note: To learn more about operating system file format search MSDN for "Portable Execution File Format." The PE header contains version numbers, link date\time, etc. The general plan here is to first find out the check sum of the customers files and then find a dbg file that has a matching check sum. There are many ways to extract the chksum from the target and the dbg. If you have access to the files, you can use the following. This example assumes you are interested in the file NTOSKRNL. LINK32: This utility can be found in the NT Build subdirectory \MSTOOLS: LINK32.EXE -DUMP -HEADERS NTOSKRNL.EXE LINK32.EXE -DUMP -HEADERS NTOSKRNL.DBG DUMPBIN: This utility can be found in the Visual C bin directory: DUMPBIN.EXE /HEADERS NTOSKRNL.EXE DUMPBIN.EXE /HEADERS NTOSKRNL.DBG If you are using a debugger on a system or a crash dump, you can find the checksum of the target file by viewing the file header in memory.
Checked VersionsIf you install debug checked versions of Windows NT files you will need to make special arrangements for they dbg symbol files. Some hotfix checked builds will have the symbolic information built into the target file. In these cases, just make a copy of the file and name it *.DBG. Place the file in the normal symbol sub directory, that is, \SYMBOLS\EXE.All publicly released check builds have separate dbg files just like the free releases. However, the dbg for checked and free versions are different. For example, the MS NT DDK contains a complete checked build of NT. It also contains a complete symbol set to go with it. NOTE: Checked versions of the NT kernel are the same for both Multiprocessor and Uniprocessor systems. Symbol LocationsRetail Product:CD-ROM \SUPPORT\DEBUG\I386\SYMBOLS Checked Builds: MS DDK For PSS Only: \\WONDER\SYMBOLS Additional query words: prodnt debugref
Keywords : kbusage nthowto |
Last Reviewed: January 28, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |