Change command stats reporting to use class
authorTom Tromey <tom@tromey.com>
Sun, 25 Sep 2016 03:10:45 +0000 (21:10 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 21 Oct 2016 20:17:35 +0000 (14:17 -0600)
commit1e3b796d58ac3c4396e1739f44a0a41de6335eef
tree110d08e5fa5cab3124dc0d6eb2864ad7675d9563
parent6fc31fc73b577fce960730d87ead9a25df6c2653
Change command stats reporting to use class

This removes make_command_stats_cleanup in favor of an RAII class.
The patch is reasonably straightforward, but keeping the same
semantics without excessive reindentation required splitting
captured_main in two.

2016-10-21  Tom Tromey  <tom@tromey.com>

* maint.h (scoped_command_stats): New class.
(make_command_stats_cleanup): Don't declare.
* maint.c (struct cmd_stats): Remove.
(~scoped_command_stats): Rename from report_command_stats.  Now a
destructor.
(scoped_command_stats): Rename from make_command_stats_cleanup.
Now a constructor.
* main.c (captured_main_1): New function.  Use
scoped_command_stats.
(captured_main): Call captured_main_1.
* event-top.c (command_handler): Use scoped_command_stats.
gdb/ChangeLog
gdb/event-top.c
gdb/main.c
gdb/maint.c
gdb/maint.h