Find, and optionally change a command in the command history.
^ string1 [^ string2 [^ string3]]
string1 |
The target string. |
string2 |
The replacement string. This string can have a zero length. |
string3 |
The string to append. |
The caret (^) finds, and optionally changes a command in the debugger's command history.
The debugger ignores leading spaces and tabs and assembles lines in the history into a new, usable command in the following manner:
The debugger extracts the following:
The string following the first caret, string1, the target string.
The string following the second caret, string2, the replacement string.
The string following the third caret, the string to append to the replacement string.
The debugger checks the most recent entry from the history list to see if it has an occurrence of the target string. If it does, the debugger replaces string1 withstring2, and then appends string3 to the end of the new command. If it does not, an error is reported.
The debugger then executes the assembled command. The debugger appends all executed command to the history list, but because ^" is not a command, but rather a history-list operation, the debugger does not append the line beginning with ^ to the history list.
(have to say that to be clear); all executed commands are appended to the history list -- but since "^" is not a command but a history-list operation, the "^" line is NOT in the history list!
You cannot use carets in braces ({}) anywhere. You can use carets in scripts. For example, the command line {print 3; ^3^4} does not parse.
You can use carets in a command file as a separate command on a separate line. For example:
p 1 ^1^2
The following example demonstrates how to use the caret to correct a command that was entered incorrectly. The command should be p 10, but pp 10 is accidentally entered at first.
(idb) pp 10 pp 10 ^ Unable to parse input as legal command or C expression. (idb) ^pp^p^ p 10 10
The following example demonstrates how to use the caret to append some text to a command:
(idb) p foo (function [0x08048534]) (idb) ^p^p^(0) p foo(0) 10
Copyright © 1996-2010, Intel Corporation. All rights reserved.