diff options
author | Andrew Stubbs <andrew.stubbs@st.com> | 2006-07-21 14:46:56 +0000 |
---|---|---|
committer | Andrew Stubbs <andrew.stubbs@st.com> | 2006-07-21 14:46:56 +0000 |
commit | 16026cd75d6c4515b5c854a7b4726678bb6ec31f (patch) | |
tree | 9f8ddfb74128d1425aef25f5cf5dcf29747a4347 /gdb/doc | |
parent | 3e4cf9243a5580b9b7766d6da9f0d5257705bf2a (diff) | |
download | gdb-16026cd75d6c4515b5c854a7b4726678bb6ec31f.zip gdb-16026cd75d6c4515b5c854a7b4726678bb6ec31f.tar.gz gdb-16026cd75d6c4515b5c854a7b4726678bb6ec31f.tar.bz2 |
2006-07-21 Andrew Stubbs <andrew.stubbs@st.com>
* cli/cli-cmds.c (source_verbose, trace_commands): New variables.
(source_script): New function.
(source_verbose_cleanup): New function.
(source_command): Move old contents to source_script.
Make function static. Parse -v option and call source_script.
(init_cli_cmds): Update source command help.
Add 'set trace-commands' command.
* cli/cli-script.c (command_next_depth): New static variable.
(suppress_next_print_command_trace): New static variable.
(reset_command_nest_depth): New function.
(print_command_trace): New function.
(execute_control_command): Split the continue_control and break_control
cases, add calls to print_command_trace and count the nest depth.
(while_command): Set suppress_next_print_command_trace.
(if_command): Likewise.
* top.c (execute_command): Call print_command_trace.
* cli/cli-cmds.h (source_verbose, trace_commands): New extern variables.
(source_command): Change to source_script.
* main.c (captued_main): Use source_script instead of source_command.
* top.h (source_command): Change to source_script.
* event-top.c (display_gdb_prompt): Call reset_command_nest_depth.
* cli/cli-script.h (print_command_trace): Export.
(reset_command_nest_depth): Likewise.
docs/
* gdb.texinfo (Optional warnings and messages): Add
'set/show trace-commands'.
(Command files): Add '-v' to source command.
testsuite/
* gdb.base/default.exp: Update source command error message.
* gdb.base/help.exp: Update 'help source' message.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 23 |
2 files changed, 28 insertions, 1 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 5d8a02a..77c14dc 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,9 @@ +2006-07-21 Andrew Stubbs <andrew.stubbs@st.com> + + * gdb.texinfo (Optional warnings and messages): Add + 'set/show trace-commands'. + (Command files): Add '-v' to source command. + 2006-07-12 Daniel Jacobowitz <dan@codesourcery.com> * gdb.texinfo (OS Information): Update qPart reference to diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index a16e4d0..1bac2b8 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -15999,6 +15999,23 @@ Displays state of confirmation requests. @end table +@cindex command tracing +If you need to debug user-defined commands or sourced files you may find it +useful to enable @dfn{command tracing}. In this mode each command will be +printed as it is executed, prefixed with one or more @samp{+} symbols, the +quantity denoting the call depth of each command. + +@table @code +@kindex set trace-commands +@cindex command scripts, debugging +@item set trace-commands on +Enable command tracing. +@item set trace-commands off +Disable command tracing. +@item show trace-commands +Display the current state of command tracing. +@end table + @node Debugging Output @section Optional messages about internal happenings @cindex optional debugging messages @@ -16347,7 +16364,7 @@ command: @table @code @kindex source @cindex execute commands from a file -@item source @var{filename} +@item source [@code{-v}] @var{filename} Execute the command file @var{filename}. @end table @@ -16360,6 +16377,10 @@ execution of the command file and control is returned to the console. @value{GDBN} searches for @var{filename} in the current directory and then on the search path (specified with the @samp{directory} command). +If @code{-v}, for verbose mode, is given then @value{GDBN} displays +each command as it is executed. The option must be given before +@var{filename}, and is interpreted as part of the filename anywhere else. + Commands that would ask for confirmation if used interactively proceed without asking when used in a command file. Many @value{GDBN} commands that normally print messages to say what they are doing omit the messages |