History Replacement of the Line
Leading spaces and tabs are removed from the assembled line.
For assembled lines that begin with an exclamation
point (!), the following rules apply:
- If the second character is also an exclamation
point (!), the assembled line is
replaced by the most-recent entry from the history list. Any remaining
characters after the digits or !
are appended to the assembled line.
- Otherwise, spaces and tabs are skipped, and
one of the following actions occurs:
- If the next character is a digit, then
the digits are read as a decimal number, and the assembled line is replaced
by that line from the history list, with 1 being the oldest entry.
- If the next character is a hyphen (-), then the digits following it are read as a
decimal number, and the assembled line is replaced by that line from the
history list, with -1 being the most-recent entry.
- Otherwise, the rest of the line is used
to find the most-recent command that starts with those characters, and
the assembled line is replaced by that line from the history list.
In the first two cases, any remaining characters after the digits
are appended to the assembled line.
For lines that begin with a caret (^), these
rules apply:
- The line is analyzed to extract the following:
- The characters following the first caret
but before a second caret, or until the end of line. These characters
are the target string.
- If there is a second caret, the characters
following it but before a third caret, or until the end of line. These
characters are the replacement string.
- If there is a third caret, the characters
following it to the end of the line. These characters are the append string.
- The most-recent entry from the history list
is checked to see if it has an occurrence of the target string. If it
does not, an error is reported.
- The assembled line is replaced by this most-recent
entry, except that the first occurrence of the target string is replaced
by the replacement string (possibly zero length), and the append string
is appended to the assembled line.
The assembled line is now appended to the history list.
Exclamation points and carets cannot be used in command lists built
with braces ({}); for example, {print3;
!!3} will not parse. They may be used in scripts.
History in a command list is not limited by braces, but goes all the
way back. For example:
(idb) print 1
1
(idb) stop at 182 { print 2; history 3 }
[#1: stop at "src/x_list.cxx":182 { print
2; history 3 }]
(idb) run
2
11: print 1
12: stop at 182 {print 2; history 3}
13: run
[1] stopped at [int main(void):182 0x08052e8f]
182
List<Node>
nodeList;
Note:
Commands in breakpoint action lists are not entered into
the history list.