Work around MinGW mangling of "host:/path"
[msysgit/historical-msysgit.git] / mingw / info / gdb / Input-Output.html
blob5f005c168d99016324906135c2a8b3a32f9325a4
1 <html lang="en">
2 <head>
3 <title>Debugging with GDB</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="Debugging with GDB">
6 <meta name="generator" content="makeinfo 4.3">
7 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
8 </head>
9 <body>
10 <div class="node">
11 <p>
12 Node:<a name="Input%2fOutput">Input/Output</a>,
13 Next:<a rel="next" accesskey="n" href="Attach.html#Attach">Attach</a>,
14 Previous:<a rel="previous" accesskey="p" href="Working-Directory.html#Working%20Directory">Working Directory</a>,
15 Up:<a rel="up" accesskey="u" href="Running.html#Running">Running</a>
16 <hr><br>
17 </div>
19 <h3 class="section">Your program's input and output</h3>
21 <p>By default, the program you run under GDB does input and output to
22 the same terminal that GDB uses. GDB switches the terminal
23 to its own terminal modes to interact with you, but it records the terminal
24 modes your program was using and switches back to them when you continue
25 running your program.
27 <dl>
28 <dt><code>info terminal</code>
29 <dd>Displays information recorded by GDB about the terminal modes your
30 program is using.
31 </dl>
33 <p>You can redirect your program's input and/or output using shell
34 redirection with the <code>run</code> command. For example,
36 <pre class="example"> run &gt; outfile
37 </pre>
39 <p>starts your program, diverting its output to the file <code>outfile</code>.
41 <p>Another way to specify where your program should do input and output is
42 with the <code>tty</code> command. This command accepts a file name as
43 argument, and causes this file to be the default for future <code>run</code>
44 commands. It also resets the controlling terminal for the child
45 process, for future <code>run</code> commands. For example,
47 <pre class="example"> tty /dev/ttyb
48 </pre>
50 <p>directs that processes started with subsequent <code>run</code> commands
51 default to do input and output on the terminal <code>/dev/ttyb</code> and have
52 that as their controlling terminal.
54 <p>An explicit redirection in <code>run</code> overrides the <code>tty</code> command's
55 effect on the input/output device, but not its effect on the controlling
56 terminal.
58 <p>When you use the <code>tty</code> command or redirect input in the <code>run</code>
59 command, only the input <em>for your program</em> is affected. The input
60 for GDB still comes from your terminal.
62 </body></html>