aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2013-03-21 17:37:30 +0000
committerDoug Evans <dje@google.com>2013-03-21 17:37:30 +0000
commitbd712aed2f88ab824d403c55a212c2be3f41a335 (patch)
tree490fa4cc174545d0a4962ef985b39c00ffad42e3 /gdb/doc
parentd76488d84eb95326e157d8deca0f626914036667 (diff)
downloadgdb-bd712aed2f88ab824d403c55a212c2be3f41a335.zip
gdb-bd712aed2f88ab824d403c55a212c2be3f41a335.tar.gz
gdb-bd712aed2f88ab824d403c55a212c2be3f41a335.tar.bz2
New commands "mt set per-command {space,time,symtab} {on,off}".
* NEWS: Add entry. * event-top.c: #include "maint.h". * main.c: #include "maint.h". * maint.c: #include <sys/time.h>, <time.h>, block.h, top.h, timeval-utils.h, maint.h, cli/cli-setshow.h. (per_command_time, per_command_space): New static globals. (per_command_symtab): New static global. (per_command_setlist, per_command_showlist): New static globals. (struct cmd_stats): Move here from utils.c. (set_per_command_time): Renamed from set_display_time in utils.c and moved here. All callers updated. (set_per_command_space): Renamed from set_display_space in utils.c and moved here. All callers updated. (count_symtabs_and_blocks): New function. (report_command_stats): Moved here from utils.c. Add support for printing symtab stats. Only print data if enabled before command executed. (make_command_stats_cleanup): Ditto. (sert_per_command_cmd, show_per_command_cmd): New functions. (_initialize_maint_cmds): Add new commands mt set per-command {space,time,symtab} {on,off}. * maint.h: New file. * top.c: #include "maint.h". * utils.c (reset_prompt_for_continue_wait_time): New function. (get_prompt_for_continue_wait_time): New function. * utils.h (reset_prompt_for_continue_wait_time): Declare (get_prompt_for_continue_wait_time): Declare. (make_command_stats_cleanup): Moved to maint.h. (set_display_time, set_display_space): Moved to maint.h and renamed to set_per_command_time, set_per_command_space. * cli/cli-setshow.c (parse_cli_boolean_value): Renamed from parse_binary_operation and made non-static. Don't call error, just return an error marker. All callers updated. * cli/cli-setshow.h (parse_cli_boolean_value): Declare. doc/ * gdb.texinfo (Maintenance Commands): Add docs for "mt set per-command {space,time,symtab} {on,off}". testsuite/ * gdb.base/maint.exp: Update tests for per-command stats.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/doc/gdb.texinfo62
2 files changed, 53 insertions, 14 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 4830331..ca4b454 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-21 Doug Evans <dje@google.com>
+
+ * gdb.texinfo (Maintenance Commands): Add docs for
+ "mt set per-command {space,time,symtab} {on,off}".
+
2013-03-14 Hui Zhu <hui@codesourcery.com>
Yao Qi <yao@codesourcery.com>
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 4ac28bb..e5e97a9 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -35721,24 +35721,33 @@ Control whether to show all non zero areas within a 1k block starting
at thread local base, when using the @samp{info w32 thread-information-block}
command.
-@kindex maint space
-@cindex memory used by commands
-@item maint space
-Control whether to display memory usage for each command. If set to a
-nonzero value, @value{GDBN} will display how much memory each command
-took, following the command's own output. This can also be requested
-by invoking @value{GDBN} with the @option{--statistics} command-line
-switch (@pxref{Mode Options}).
+@kindex maint set per-command
+@kindex maint show per-command
+@item maint set per-command
+@itemx maint show per-command
+@cindex resources used by commands
-@kindex maint time
-@cindex time of command execution
-@item maint time
-Control whether to display the execution time of @value{GDBN} for each command.
-If set to a nonzero value, @value{GDBN} will display how much time it
+@value{GDBN} can display the resources used by each command.
+This is useful in debugging performance problems.
+
+@table @code
+@item maint set per-command space [on|off]
+@itemx maint show per-command space
+Enable or disable the printing of the memory used by GDB for each command.
+If enabled, @value{GDBN} will display how much memory each command
+took, following the command's own output.
+This can also be requested by invoking @value{GDBN} with the
+@option{--statistics} command-line switch (@pxref{Mode Options}).
+
+@item maint set per-command time [on|off]
+@itemx maint show per-command time
+Enable or disable the printing of the execution time of @value{GDBN}
+for each command.
+If enabled, @value{GDBN} will display how much time it
took to execute each command, following the command's own output.
Both CPU time and wallclock time are printed.
Printing both is useful when trying to determine whether the cost is
-CPU or, e.g., disk/network, latency.
+CPU or, e.g., disk/network latency.
Note that the CPU time printed is for @value{GDBN} only, it does not include
the execution time of the inferior because there's no mechanism currently
to compute how much time was spent by @value{GDBN} and how much time was
@@ -35746,6 +35755,31 @@ spent by the program been debugged.
This can also be requested by invoking @value{GDBN} with the
@option{--statistics} command-line switch (@pxref{Mode Options}).
+@item maint set per-command symtab [on|off]
+@itemx maint show per-command symtab
+Enable or disable the printing of basic symbol table statistics
+for each command.
+If enabled, @value{GDBN} will display the following information:
+
+@table @bullet
+@item number of symbol tables
+@itemx number of primary symbol tables
+@itemx number of blocks in the blockvector
+@end table
+@end table
+
+@kindex maint space
+@cindex memory used by commands
+@item maint space @var{value}
+An alias for @code{maint set per-command space}.
+A non-zero value enables it, zero disables it.
+
+@kindex maint time
+@cindex time of command execution
+@item maint time @var{value}
+An alias for @code{maint set per-command time}.
+A non-zero value enables it, zero disables it.
+
@kindex maint translate-address
@item maint translate-address @r{[}@var{section}@r{]} @var{addr}
Find the symbol stored at the location specified by the address