aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/maint.exp
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/testsuite/gdb.base/maint.exp
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/testsuite/gdb.base/maint.exp')
-rw-r--r--gdb/testsuite/gdb.base/maint.exp20
1 files changed, 3 insertions, 17 deletions
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index e3b6e3c..a867c50 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -21,10 +21,8 @@
#maintenance check-symtabs -- Check consistency of psymtabs and symtabs
-#maintenance space -- Set the display of space usage
#maintenance set -- Set GDB internal variables used by the GDB maintainer
#maintenance show -- Show GDB internal variables used by the GDB maintainer
-#maintenance time -- Set the display of time usage
#maintenance demangle -- Demangle a C++ mangled name
#maintenance dump-me -- Get fatal error; make debugger dump its core
#maintenance print -- Maintenance command for printing GDB internal state
@@ -126,22 +124,10 @@ gdb_expect {
timeout { fail "(timeout) maint check-symtabs" }
}
-gdb_test "maint space" \
- "\"maintenance space\" takes a numeric argument\\."
+gdb_test_no_output "maint set per-command on"
-gdb_test "maint space 1" \
- "Space used: $decimal \\(\\+$decimal for this command\\)"
-
-gdb_test "maint time" \
- "\"maintenance time\" takes a numeric argument\\..*Space used: $decimal \\(\\+$decimal for this command\\)"
-
-gdb_test "maint time 1" \
- "Command execution time: $decimal.*Space used: $decimal \\(\\+$decimal for this command\\)"
-
-gdb_test "maint time 0" \
- "Space used: $decimal \\(\\+$decimal for this command\\)"
-
-gdb_test_no_output "maint space 0"
+gdb_test "maint set per-command off" \
+ "Command execution time: \[0-9.\]+ \\(cpu\\), \[0-9.\]+ \\(wall\\)\[\r\n\]+Space used: $decimal \\(\\+$decimal for this command\\)\[\r\n\]+#symtabs: $decimal \\(\\+$decimal\\), #primary symtabs: $decimal \\(\\+$decimal\\), #blocks: $decimal \\(\\+$decimal\\)"
gdb_test "maint demangle" \
"\"maintenance demangle\" takes an argument to demangle\\."