Buy the book!
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
By default, the program you run under GDB does input and output to the same terminal that GDB uses. GDB switches the terminal to its own terminal modes to interact with you, but it records the terminal modes your program was using and switches back to them when you continue running your program.
You can redirect your program's input and/or output using shell
redirection with the
run command. For example,
run > outfile
starts your program, diverting its output to the file `outfile'.
Another way to specify where your program should do input and output is
tty command. This command accepts a file name as
argument, and causes this file to be the default for future
commands. It also resets the controlling terminal for the child
process, for future
run commands. For example,
directs that processes started with subsequent
default to do input and output on the terminal `/dev/ttyb' and have
that as their controlling terminal.
An explicit redirection in
run overrides the
effect on the input/output device, but not its effect on the controlling
When you use the
tty command or redirect input in the
command, only the input for your program is affected. The input
for GDB still comes from your terminal.
|webmaster||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|