record (idb mode only)

Record debugger interactions to a file.

Syntax

record { input | output | io } [file]

Parameters

file

The file to which you want to record interactions.

input

Records input only.

output

Records output only.

io

Records input and output.

Description

This command records debugger input, output, or both.

To help you make command files, as well as to help you see what has happened before, the debugger can write both its input and its output to files.

The record input command saves debugger commands to a file. You can execute the commands in the file using the source command or the playback input command.

If you do not specify a file name, the debugger creates a file with a random file name in /tmp as the record file. The debugger issues a message giving the name of that file.

The record output command saves the debugger output to a file. The output is simultaneously written to stdout (normal output) or stderr (error messages).

To stop recording debugger input or output, use the appropriate version of the unrecord command, then exit the debugger, or redirect the command to /dev/null, as shown in the following example:

(idb) record input /dev/null
(idb) record output /dev/null
(idb) record io /dev/null

The record io command saves both input to and output from the debugger. If the debugger is already recording input or output when you invoke this command, the debugger closes the old file and records to a new one. It does not record simultaneously to two files.

record io is equivalent to the combination of record input and record output, and closes any open recording files.

Note iconNote

Only the record io command records the prompt itself.

Example

The following example shows how to use the record input command to record a series of debugger commands in a file named myscript:

(idb) record input myscript
(idb) stop in main
[#1: stop in int main(void)] 
(idb) run
[1] stopped at [int main(void):182 0x08051603] 
182 List<Node> nodeList; 
(idb) unrecord input
This example results in the following recorded input in myscript: 
(idb) sh cat myscript
stop in main 
run 
unrecord input 

The following example shows how to use the record output command to record a series of debugger commands in a file named myscript:

(idb) record output myscript
(idb) stop in List<Node>::append
[#2: stop in void List<Node>::append(class Node* const)] 
(idb) cont
[2] stopped at [void List<Node>::append(class Node* const):148 0x0804ae5a] 
148 if (!_firstNode) 
(idb) cont to 156
stopped at [void List<Node>::append(class Node* const):156 0x0804aed7] 
156 } 
(idb) unrecord output

After the above commands are executed, myscript contains the following:

(idb) sh cat myscript
[#2: stop in void List<Node>::append(class Node* const)] 
[2] stopped at [void List<Node>::append(class Node* const):148 0x0804ae5a] 
148 if (!_firstNode) 
stopped at [void List<Node>::append(class Node* const):156 0x0804aed7] 
156 } 

The following example shows how record io records input and output.

(idb) record io myscript
(idb) stop in main 
[#1: stop in int main(void) ] 
(idb) run
[1] stopped at [int main(void):12 0x120001130] 
12 int i; 
(idb) quit  
% cat myscript 
(idb) stop in main
[#1: stop in int main(void) ] 
(idb) run
[1] stopped at [int main(void):12 0x120001130] 
12 int i; 
(idb) quit

See Also


Submit feedback on this help topic

Copyright © 2001-2011, Intel Corporation. All rights reserved.