From 0f3bb72eb70f61f3154fd51eaac173bd6486f3d6 Mon Sep 17 00:00:00 2001 From: "Paul N. Hilfinger" Date: Sat, 26 Jun 2010 06:44:47 +0000 Subject: Refactor 'maint time' command statistics. Consolidate code for displaying per-command time and space statistics to avoid duplication. Piggyback on cleanups so that statistics get printed even when commands terminate as a result of an error. Changelog * gdb/defs.h (make_command_stats_cleanup): Declare. (set_display_time): Declare. (set_display_space): Declare. * gdb/event-top.c (command_handler): Use make_command_stats_cleanup. * gdb/main.c (display_time, display_space): Move definitions to utils.c. (captured_main): Use make_command_stats_cleanup to get start-up statistics. Use set_display_time and set_display_space for processing OPT_STATISTICS case. * gdb/maint.c (maintenance_time_display): Use set_display_time. (maintenance_space_display): Use set_display_space. * gdb/top.c (execute_command): Remove obsolete 'maint time' code. (command_loop): Use make_command_stats_cleanup. * gdb/utils.c (struct cmd_stats): Structure for storing initial time and space usage. (display_time, display_space): Move definitions here from utils.c. (set_display_time): New function. (set_display_space): New function. (make_command_stats_cleanup): New function. (report_command_stats): New auxiliary function for make_command_stats_cleanup. * gdb/testsuite/gdb.gdb/selftest.exp: Adjust expected message for capturing start-up runtime. --- gdb/ChangeLog | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'gdb/ChangeLog') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5291bf0..48cd478 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,27 @@ +2010-06-25 Paul Hilfinger + + * defs.h (make_command_stats_cleanup): Declare. + (set_display_time): Declare. + (set_display_space): Declare. + * event-top.c (command_handler): Use make_command_stats_cleanup. + * main.c (display_time, display_space): Move definitions to utils.c. + (captured_main): Use make_command_stats_cleanup to get start-up + statistics. + Use set_display_time and set_display_space for processing OPT_STATISTICS + case. + * maint.c (maintenance_time_display): Use set_display_time. + (maintenance_space_display): Use set_display_space. + * top.c (execute_command): Remove obsolete 'maint time' code. + (command_loop): Use make_command_stats_cleanup. + * utils.c (struct cmd_stats): Structure for storing initial time + and space usage. + (display_time, display_space): Move definitions here from utils.c. + (set_display_time): New function. + (set_display_space): New function. + (make_command_stats_cleanup): New function. + (report_command_stats): New auxiliary function for + make_command_stats_cleanup. + 2010-06-25 Ulrich Weigand * solib-spu.c (append_ocl_sos): Fix xsnprintf statement for -- cgit v1.1