User`s guide
Using the History Feature and the History Editor
23
For example:
(dbx) next 5
Process 22545 (test) stopped at [main:60 ,0x10001150]
60 total += j;
(dbx) !!
(!! = next 5)
Process 22545 (test) stopped at [main:65 ,0x100011a0]
65 printf(“i = %d, j = %d, total = %d\n”,i,j,total);
Another convenient way to repeat a commonly used command is with
!string. For example, suppose that you occasionally print the values of
certain variables using the printf command while running your program
under dbx. (The printf command is described in “Printing Expressions” on
page 37.) In this case, as long as you do not enter any command beginning
with “pr” after you enter the printf command, you can repeat the printf
command by entering !pr. For example:
(dbx) printf "i = %d, j = %d, total = %d\n", i, j, total
i = 4, j = 25, total = 1
...
(dbx) !pr
i = 12, j = 272, total = 529
Using !integer, you can repeat any command in the history list. If you want
to repeat the printf command, but you have entered a subsequent print
command, examine the history list and then explicitly repeat the printf
command using its reference number. For example:
(dbx) history
1 set $prompt = “(dbx)”
2 set $page=0
...
45 printf "i = %d, j = %d, total = %d\n", i, j, total
46 next
...
49 print j
...
53 history
(dbx) !45
(!45 = printf "i = %d, j = %d, total = %d\n", i, j, total)
i = 9, j = 43, total = 1084