Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Usage

Quick start

Simply run

   cv2pdb debuggee.exe

on your executable to debug and start the debugger, for example

   devenv debuggee.exe

or

   vcexpress debuggee.exe

Description

cv2pdb.exe is a command line tool which outputs its usage information if run without arguments:

   usage: cv2pdb [-Dversion|-C|-n] <exe-file> [new-exe-file] [pdb-file]

With the -D option, you can specify the version of the DMD compiler you are using. Unfortunately, this information is not embedded into the debug information. The default is -D2. So far, this information is only needed to determine whether "char[]" or "const char[]" is translated to "string".

Starting with DMD 2.043, assoiciative arrays have a slightly different implementation, so debug information needs to be adjusted aswell. Use -D 2.043 or higher to produce the matching debug info.

Option -C tells the program, that you want to debug a program compiled with DMC, the Digital Mars C/C++ compiler. It will disable some of the D specific functions and will enable adjustment of stack variable names.

Option -n disables name demangling. This can be helpful if the executable or other tools examine the debug info and need the type information contained in the mangled names.

The first file name on the command line is expected to be the executable or dynamic library compiled by the DMD compiler and containing the CodeView debug information (-g option used when running dmd).

If no further file name is given, a PDB file will be created with the same base name as the executable, but with extension "pdb", and the executable will be modified to redirect debuggers to this pdb-file instead of the original debug information.

Example:

   cv2pdb debuggee.exe

In an environment using make-like tools, it is often useful to create a new file instead of modifying existing files. That way the file modification time can be used to continue the build process at the correct step. If another file name is specified, the new executable is written to this file and leaves the input executable unmodified. The naming of the pdb-file will use the base name of the output file.

Example:

   cv2pdb debuggee.exe debuggee_pdb.exe

Last but not least, the resulting pdb-file can be renamed by specifying a third file name.

Example:

   cv2pdb debuggee.exe debuggee_pdb.exe debug.pdb