Execute commands from a batch file.
source filename
filename |
The file from which to execute commands. |
This command specifies a file from which the debugger reads and executes a series of commands.
Alternatively, you can execute debugger commands when you invoke the debugger by creating an initialization file named .idbrc or .dbxinit.
If you place commands in a file, you can execute them directly from the file rather than cutting and pasting them to the terminal. These commands can be nested. If you have multiple command files, the debugger continues reading and processing the commands in a subsequent file immediately after processing the final command of the previous file.
The following rules and guidelines apply to command files:
Blank lines in command files do not repeat the last command, as opposed to blank lines entered directly from the prompt.
Format the commands as if they were entered at the debugger prompt.
Use the pound character (#) to create comments to format your scripts.
When the debugger executes a command file, the value of the $pimode debugger variable determines whether the commands are echoed. If the $pimode variable is set to 1, commands are echoed. If $pimode is set to 0, the default, commands are not echoed. The debugger output resulting from the commands is always echoed.
The following example is a debugger script named ../src/myscript:
step where 2
The following example shows how to execute this script:
(idb) run [1] stopped at [int main(void):187 0x080516aa] 188 nodeList.append(newNode); {static int somethingToReturnTo; somethingToReturnTo++; } (idb) source ../src/myscript stopped at [void List<Node>::append(class Node* const):148 0x0804ae5a] 148 if (!_firstNode) >0 0x0804ae5a in ((List<Node>*)0xbfffa460)->List<Node>::append(node=0x805c500) "src/x_list.cxx":148
Copyright © 2001-2011, Intel Corporation. All rights reserved.