]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/doc/gdb.texinfo
./
[thirdparty/binutils-gdb.git] / gdb / doc / gdb.texinfo
index 05715e137df11ac4aa6e1f20ba19ea2b585403a3..e6da37c3b80fc718a6baa421cae35c06d2080183 100644 (file)
@@ -757,6 +757,7 @@ type @kbd{quit} or @kbd{C-d} to exit.
 * Invoking GDB::                How to start @value{GDBN}
 * Quitting GDB::                How to quit @value{GDBN}
 * Shell Commands::              How to use shell commands inside @value{GDBN}
+* Logging output::              How to log @value{GDBN}'s output to a file
 @end menu
 
 @node Invoking GDB
@@ -1210,6 +1211,32 @@ Execute the @code{make} program with the specified
 arguments.  This is equivalent to @samp{shell make @var{make-args}}.
 @end table
 
+@node Logging output
+@section Logging output
+@cindex logging @value{GDBN} output
+
+You may want to save the output of @value{GDBN} commands to a file.
+There are several commands to control @value{GDBN}'s logging.
+
+@table @code
+@kindex set logging
+@item set logging on
+Enable logging.
+@item set logging off
+Disable logging.
+@item set logging file @var{file}
+Change the name of the current logfile.  The default logfile is @file{gdb.txt}.
+@item set logging overwrite [on|off]
+By default, @value{GDBN} will append to the logfile.  Set @code{overwrite} if
+you want @code{set logging on} to overwrite the logfile instead.
+@item set logging redirect [on|off]
+By default, @value{GDBN} output will go to both the terminal and the logfile.
+Set @code{redirect} if you want output to go only to the log file.
+@kindex show logging
+@item show logging
+Show the current values of the logging settings.
+@end table
+
 @node Commands
 @chapter @value{GDBN} Commands