User`s guide
18
Chapter 3: Examining Source Files
?[reg_exp] Search backward through the current file from the current
line for the regular expression reg_exp. If dbx reaches the
beginning of the file without finding the regular expression,
it wraps around to the end of the file. dbx prints the first
source line containing a match of the search expression.
If you don’t supply a regular expression, dbx searches
backward based on the last regular expression searched.
For example, to search forward for the next occurrence of the string “errno,”
enter:
(dbx) /errno
To search backward for the previous occurrence of either “img” or “Img,”
enter:
(dbx) ?[iI]mg
Calling an Editor
The edit command lets you edit files from within dbx:
edit The edit command invokes an editor (vi by default) on the
current source file. If you set the dbx variable $editor to the
name of an editor, the edit command invokes that editor. If
you do not set the $editor, dbx checks the environment
variable EDITOR and, if set, invokes that editor. When you
exit the editor, you return to the dbx prompt.
edit file The edit command invokes the editor on the given file.
edit procedure The edit command invokes the editor on the file that
contains the source for the given procedure.
For example, to edit a file named soar.c from within dbx, type:
(dbx) edit soar.c
The edit command is also useful for editing dbx script files. See “Executing
dbx Scripts” on page 32 for more information on script files.