Debugging Tools for Windows |
PDBCopy is a command-line tool that creates a stripped symbol file from a full symbol file. In other words, it takes a symbol file that contains both private symbol data and a public symbol table, and creates a copy of that file that contains only the public symbol table. Depending on which PDBCopy options are used, the stripped symbol file contains either the entire public symbol table or a specified subset of the public symbol table.
PDBCopy works with any PDB-format symbol file (with file name extension .pdb), but not with the older format (.dbg) symbol files.
For a description of public symbol tables and private symbol data, see Public and Private Symbols.
If you wish to create a stripped symbol file that contains all the public symbols and none of the private symbols, use PDBCopy with three parameters: the path and name of the original symbol file, the path and name of the new symbol file, and the
For example, the following command creates a new file, named publicsymbols.pdb, which contains the same public symbol table as mysymbols.pdb but contains none of the private symbol data:
If mysymbols.pdb happens to already be a stripped symbol file, the symbolic content of the new file and the old file will be identical.
After issuing this command, you should move the new file to a new location and rename it to the original name of the symbol file (in this example, mysymbols.pdb), because most debugging programs and symbol extraction programs look for symbols based on a specific file name. Alternatively, you could use the same file name for the input file and the output file on the PDBCopy command line, as long as different directories are specified:
Note The destination file should not exist before PDBCopy is run. If a file with this name exists, various errors may occur.
If you wish to not only remove the private symbol data, but also reduce the amount of information in the public symbol table, you can use the
The following example illustrates this procedure:
_myGlobal2
The file can be given any name you choose. Let us suppose that you name this file listfile.txt and place it in the directory C:\Temp.
where OldPDB and NewPDB are the original symbol file and the new symbol file, and TextFile is the file created in step two. The
In the current example, the command would look like this:
This creates a new symbol file, C:\dir2\mysymbols.pdb, which does not contain any private symbols and does not contain the two global variables you listed in listfile.txt.
As shown in this example, PDBCopy's
Unless you wish to remove only one or two symbols, it is simpler to use a text file than to list them on the command line.
If you wish to remove the majority of public symbols from your .pdb file, the
For example, the following command removes all private symbols and almost all public symbols, leaving only the symbols _myFunction5 and _myGlobal7:
If you combine multiple instances of the
The
The
PDBCopy must access either the mspdb80.dll file or the mspdb60.dll file in order to run. By default, PDBCopy uses mspdb80.dll, which is the version used by Visual Studio .NET 2002 and later versions of Visual Studio. If your symbols were built using Visual Studio 6.0 or an earlier version, you can specify the
Before running PDBCopy, make sure that the correct version of mspdb*.dll file is accessible to your computer, and make sure that its location is part of the command path. If it is not, you should use the path command to add this location to the command path.
Each symbol file has a fixed signature that uniquely identifies it. SymSrv uses the signature to generate a unique "index value" for the file. If two files have different contents or different creation times, they will also have distinct signatures and distinct SymSrv index values.
Files created with PDBCopy are an exception to the rule of unique index values. When PDBCopy creates a new symbol file, it has the same signature and SymSrv index value as the old file. This feature allows one file to be replaced with the other without altering the behavior of symbol-related tools.
If you wish the new file to have a distinct signature and SymSrv index, use the
For the complete command line syntax, see PDBCopy Command-Line Options.