User`s guide

Creating and Removing dbx Aliases
27
The “p” alias takes four arguments and prints them surrounded by vertical
bars (|). For example:
(dbx) p(1,2,3,4)
|1|2|3|4|
(dbx) p( first, second, 3rd,4)
| first| second| 3rd|4|
In the previous example, dbx retains any spaces that you enter when calling
an alias.
You can also omit arguments when calling an alias as long as you include the
commas as argument separators in the alias call:
(dbx) p(a,,b,c)
|a||b|c|
(dbx) p(,first missing, preceding space,)
||first missing| preceding space||
(dbx) delete
delete
Removing Command Aliases
The unalias command removes the alias you provide as an argument. For
example, to remove the “pa” alias defined in the previous section, enter:
(dbx) unalias pa
You can remove any of the predefined dbx aliases; however, these aliases are
restored the next time you start dbx.
Alias Example
An easy way to follow linked lists is to use aliases and casts. This example
shows how to construct an alias that follows a simple linked list with
members defined by the following structure:
struct list { struct list *next; int value; };
In this example, a dbx variable called $p is used as a pointer to a member of
the linked list. You can define an alias called “foll” to print the contents of the
list member to which $p currently points and then advance to the next list