^

Find, and optionally change a command in the command history.

Syntax

^ string1 [^ string2 [^ string3]]

Parameters

string1

The target string.

string2

The replacement string. This string can have a zero length.

string3

The string to append.

Description

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 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

Example

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

See Also


Submit feedback on this help topic

Copyright © 1996-2010, Intel Corporation. All rights reserved.