This is the mail archive of the
mailing list for the GDB project.
Re: [RFA 11/22] Change command stats reporting to use class
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Sun, 9 Oct 2016 18:01:48 +0100
- Subject: Re: [RFA 11/22] Change command stats reporting to use class
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <email@example.com>
On 09/27/2016 05:08 AM, Tom Tromey wrote:
> This removes make_command_stats_cleanup in favor of an RAII class.
> The patch is reasonably straightforward, but keeping the same
> semantics required reindenting much of captured_main.
Did you try splitting the reindented code to a separate
function instead? Like:
... existing code, except the command stats business
/* Set this before constructing scoped_command_stats. */
lim_at_start = (char *) sbrk (0);
scoped_command_stats stat_reporter (0);
/* NOTE: cagney/1999-11-07: There is probably no reason for not
moving this loop and the code found in captured_command_loop()
into the command_loop() proper. The main thing holding back that
change - SET_TOP_LEVEL() - has been eliminated. */
catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
I imagine that results in a much smaller diff, and probably
Once someone fixes that NOTE, then we can even remove the extra
scope around scoped_command_stats. Or if we fixed that NOTE
before this patch, then we wouldn't need the separate function
nor the reindenting at all.