1 /* Support for GDB maintenance commands.
2 Copyright (C) 2013-2016 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 extern void set_per_command_time (int);
24 extern void set_per_command_space (int);
26 /* Records a run time and space usage to be used as a base for
27 reporting elapsed time or change in space. */
29 class scoped_command_stats
33 explicit scoped_command_stats (bool msg_type
);
34 ~scoped_command_stats ();
38 // No need for these. They are intentionally not defined anywhere.
39 scoped_command_stats
&operator= (const scoped_command_stats
&);
40 scoped_command_stats (const scoped_command_stats
&);
42 /* Zero if the saved time is from the beginning of GDB execution.
43 One if from the beginning of an individual command execution. */
45 /* Track whether the stat was enabled at the start of the command
46 so that we can avoid printing anything if it gets turned on by
47 the current command. */
48 int m_time_enabled
: 1;
49 int m_space_enabled
: 1;
50 int m_symtab_enabled
: 1;
51 long m_start_cpu_time
;
52 struct timeval m_start_wall_time
;
54 /* Total number of symtabs (over all objfiles). */
55 int m_start_nr_symtabs
;
56 /* A count of the compunits. */
57 int m_start_nr_compunit_symtabs
;
58 /* Total number of blocks. */
59 int m_start_nr_blocks
;