GDB (xrefs)
/tmp/gdb-8.1/gdb/maint.h
Go to the documentation of this file.
1 /* Support for GDB maintenance commands.
2  Copyright (C) 2013-2018 Free Software Foundation, Inc.
3 
4  This file is part of GDB.
5 
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.
10 
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.
15 
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/>. */
18 
19 #ifndef MAINT_H
20 #define MAINT_H
21 
22 #include "run-time-clock.h"
23 #include <chrono>
24 
25 extern void set_per_command_time (int);
26 
27 extern void set_per_command_space (int);
28 
29 /* Records a run time and space usage to be used as a base for
30  reporting elapsed time or change in space. */
31 
33 {
34  public:
35 
36  explicit scoped_command_stats (bool msg_type);
38 
39  private:
40 
41  // No need for these. They are intentionally not defined anywhere.
44 
45  /* Zero if the saved time is from the beginning of GDB execution.
46  One if from the beginning of an individual command execution. */
47  bool m_msg_type;
48  /* Track whether the stat was enabled at the start of the command
49  so that we can avoid printing anything if it gets turned on by
50  the current command. */
51  int m_time_enabled : 1;
52  int m_space_enabled : 1;
55  std::chrono::steady_clock::time_point m_start_wall_time;
57  /* Total number of symtabs (over all objfiles). */
59  /* A count of the compunits. */
61  /* Total number of blocks. */
63 };
64 
65 #endif /* MAINT_H */
run_time_clock::time_point m_start_cpu_time
Definition: maint.h:54
scoped_command_stats(bool msg_type)
Definition: maint.c:864
scoped_command_stats & operator=(const scoped_command_stats &)
int m_start_nr_symtabs
Definition: maint.h:58
int m_start_nr_compunit_symtabs
Definition: maint.h:60
std::chrono::steady_clock::time_point m_start_wall_time
Definition: maint.h:55
void set_per_command_space(int)
Definition: maint.c:755
int m_symtab_enabled
Definition: maint.h:53
std::chrono::time_point< run_time_clock > time_point
long m_start_space
Definition: maint.h:56
int m_start_nr_blocks
Definition: maint.h:62
void set_per_command_time(int)
Definition: maint.c:746