DBH Commands

From the DBH command line, you can use a variety of commands to analyze symbols and symbol files.

The following table lists the commands that control the DBH options and perform other basic tasks.

CommandEffect

verbose [on|off]

Turns verbose mode on or off. With no parameter, displays the current verbose mode setting.

sympath [Path]

Sets the symbol search path. With no parameter, displays the current symbol search path.

symopt Options

symopt +Options

symopt -Options

symopt

Sets the symbol options. With no + or -, the value of Options replaces the current symbol options. If + or - is used, Options specifies the options to be added or removed; there must be a space before the + or - but no space after it. With no parameter, the current symbol options are displayed. When DBH is launched, the default value of all the symbol options is 0x10C13. For a list of available options, see Setting Symbol Options.

help

Displays help text for the DBH commands.

quit

Quits the DBH program.

 

The following table lists the commands that load, unload, and rebase the target module. These commands cannot be used if DBH was started by specifying a process ID on the command line.

CommandEffect

load File

Loads the specified module. File should specify the path, file name, and file name extension of either the executable file or the symbol file.

unload

Unloads the current module.

base Address

Sets the default base address to the specified value. All symbol addresses will be determined relative to this base address.

 

The following table lists the commands that search for files and display directory information.

CommandEffect

findexe File Path

Locates the specified executable file in the specified path, using the FindExecutableImage routine.

finddbg File Path

Locates the specified .dbg file in the specified path. Including the .dbg extension is optional.

dir File Path

Locates the specified file in the specified path or in any subdirectory under this path, using the EnumDirTree routine.

srchtree Path File

Locates the specified file in the specified path or in any subdirectory under this path, using the SearchTreeForFile routine. This command is the same as dir, except that the parameters are reversed.

ffpath File

Finds the specified file in the current symbol path.

 

The following table lists the commands that parse the module list and control the default module. The default module and its base address are displayed on the DBH prompt.

CommandEffect

mod Address

Changes the default module to the module with the specified base address.

refresh

Refreshes the module list.

omap

Displays the module OMAP structures.

epmod PID

Enumerates all the modules loaded for the specified process. PID specifies the process ID of the desired process.

info

Displays information about the currently loaded module.

obj Mask

Lists all object files associated with the default module that match the specified pattern. Mask may contain a variety of wildcard characters and specifiers; see String Wildcard Syntax for details.

src Mask

Lists all source files associated with the default module that match the specified pattern. Mask may contain a variety of wildcard characters and specifiers; see String Wildcard Syntax for details.

enummod

Enumerates all loaded modules. There is always at least one module, unless DBH is running without a target, in which case there are none.

 

The following table lists the commands that display and search for symbols.

CommandEffect

enum Module!Symbol

Enumerates all symbols matching the specified module and symbol. Module specifies the module to search (without the file name extension). Symbol specifies a pattern that the symbol must contain. Both Module and Symbol may contain a variety of wildcard characters and specifiers; see String Wildcard Syntax for details.

enumaddr Address

Enumerates all symbols associated with the specified address.

addr Address

Displays detailed information about the symbols associated with the specified address.

name [Module!]Symbol

Displays detailed information about the specified symbol. An optional Module specifier may be included. Wildcards should not be used, because if multiple symbols match the pattern, name only displays the first of them.

next [Module!]Symbol

next Address

Displays detailed information about the next symbol after the specified symbol or address. If a symbol is specified by name, an optional Module specifier may be included, but wildcards should not be used.

prev [Module!]Symbol

prev Address

Displays detailed information about the first symbol previous to the specified symbol or address. If a symbol is specified by name, an optional Module specifier may be included, but wildcards should not be used.

line File#LineNum

Displays the hexadecimal address of the binary instruction associated with the specified source line, and any symbols associated with this line. Also sets the current line number equal to the specified line number. File specifies the name of the source file, and LineNum specifies the line number within that file; these should be separated with a number sign ( # ).

srclines File LineNum

Displays the object files associated with the specified source line, and the hexadecimal address of the binary instruction associated with this line. Does not change the current line number. File specifies the name of the source file, and LineNum specifies the line number within that file; these should be separated with a space.

laddr Address

Displays the source file and line number corresponding to the symbol located at the specified address.

linenext

Increments the current line number, and displays information about the new line number.

lineprev

Decrements the current line number, and displays information about the new line number.

locals Function [Mask]

Displays all local variables contained within the specified function. If Mask is included, only those locals matching the specified pattern are displayed; see String Wildcard Syntax for details.

type TypeName

Displays detailed information about the specified data type. TypeName specifies the name of the data type (for example, WSTRING). If no type name matches this value, any matching symbol will be displayed. Unlike most DBH command parameters, TypeName is case-sensitive.

elines [Source [Obj]]

Enumerates all source lines matching the specified source mask and object mask. Source specifies the name of the source file, including the absolute path and file name extension. Obj specifies the name of the object file, including the relative path and file name extension. Both Source and Obj may contain a variety of wildcard characters and specifiers; see String Wildcard Syntax for details. If a parameter is omitted this is equivalent to using the asterisk (*) wildcard. If you do not wish to specify path information, prefix the file name with *\ to indicate a wildcard path.

index Value

Displays detailed information about the symbol with the specified index value.

scope Address

scope [Module!]Symbol

Displays detailed information about the parent of the specified symbol. The symbol may be specified by address or by name.

srch [mask=Symbol] [index=Index] [tag=Tag] [addr=Address] [globals]

Searches for all symbols that match the specified masks. Symbol specifies the symbol name. It should not include the module name, but it may contain wildcard characters and specifiers; see String Wildcard Syntax for details. Index specifies the hexadecimal address of a symbol to be used as the parent for the search. Tag specifies the hexadecimal symbol type classifier (SymTagXxx) value that must match the symbol. Address specifies the address of the symbol. If globals is included, only global symbols will be displayed.

uw Address

Displays the unwind information for the function at the specified address.

dtag

Displays all the symbol type classifier (SymTagXxx) values.

etypes

Enumerates all data types.

dump

Displays a complete list of all symbol information in the target file.

 

The following table lists the commands that relate to symbol servers and symbol stores.

CommandEffect

home [Path]

Sets the home directory used by SymSrv and SrcSrv for the default downstream store. If the symbol path contains a reference to a symbol server that uses a default downstream store, then the sym subdirectory of the home directory will be used for the downstream store. With no parameter, home displays the current home directory.

srvpath Path

Tests whether the specified path is the path of a symbol store.

srvind File

Finds the symbol server index that corresponds to the specified file. The symbol server index is a unique value based on the contents of the file, regardless of whether it actually has been added to any symbol store. File should specify the file name and absolute path of the desired file.

fii File

Displays the symbol server indexes for the specified binary file and its associated files.

getfile File Index

Displays the file with the specified name and symbol server index. File specifies the name of the desired file; this should not include its path. Index specifies the symbol server index of the desired file. DBH uses the SymFindFileInPath routine to search the tree under the current symbol path for a file with this name and this index.

sup Path File1 File2

Stores a file in a symbol store, based on the values of the parameters. Path specifies the directory path of the symbol store. File1 and File2 are used to create a delta value, which is in turn used to determine the file being stored.

storeadd File Store

Adds the specified file to the specified symbol store. Store should be the root path of the symbol store.

 

The following table lists the DBH commands that apply to real and imaginary symbols.

CommandEffect

undec Name

Reveals the meaning of the decorations attached to the specified symbol name. Name can be any string; it need not correspond to a currently loaded symbol. If Name contains C++ decorations, the meaning of these decorations is displayed.

add Name Address Size

Adds the specified imaginary symbol to the list of symbols loaded in DBH. Name specifies the name of the symbol to be added, Address specifies its hexadecimal address, and Size its hexadecimal size in bytes. This is treated like any other symbol in later DBH commands, until the DBH session is ended with quit or unload, or until the imaginary symbol is deleted with del. The actual target symbol file is not altered.

del Name

del Address

Deletes an imaginary symbol previously added with the add command. The symbol can be specified either by name or by address. This cannot be used to delete real symbols.

 

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft