In This Book

Macro names may begin with a letter, a grave (`) accent, a hyphen (-) or an underscore (_). Macros accept parameters and are de￿ned like C language macros. See the descriptions of the alias and define commands in the online command reference for syntax details.

You must delimit a macro name in a command string with characters not allowed in a macro name, such as the space character. For example:

define

X len

De￿nes macro X as len.

print

X

Expands to print len.

print

myX

Does not expand because the debugger does not treat the

 

 

letter y as a delimiter.

Start a macro name with a grave accent (`) to form a macro that can concatenate its text with other strings. For example:

define `X len De￿nes macro `X as len.

print

`X

Expands

to print

len.

print

my`X

Expands

to print

mylen.

Like arguments to debugger commands, macros are case-sensitive. You can list alias macros using the list aliases command; use list defines to list de￿ne macros.

You can specify any string as the value for an actual parameter. The debugger recognizes any string within matching brackets [], braces `fg'', or parentheses () as a single argument. However, bracket pairs within the string are treated in a special manner, and quotation marks are treated as part of the string. The outermost brackets (within the parentheses that delimit the argument) must balance; brackets, characters, and punctuation marks within the outermost brackets are considered part of the argument.

A period (.) preceding a command string prev ents the debugger from trying to expand the string in an alias or de￿ne macro. F or example, using the period can prevent in￿nite looping in the following alias:

alias s[tep] .step -ignore

Without the p eriod, when the debugger encoun ters the step command string, it would continue to apply the alias de￿nition inde￿nitely .

5-10 Using Debugger Commands