Fix ARI text for floatformat_from_double
[deliverable/binutils-gdb.git] / gdb / maint.h
CommitLineData
bd712aed 1/* Support for GDB maintenance commands.
42a4f53d 2 Copyright (C) 2013-2019 Free Software Foundation, Inc.
bd712aed
DE
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
268a13a5 22#include "gdbsupport/run-time-clock.h"
dcb07cfa
PA
23#include <chrono>
24
bd712aed
DE
25extern void set_per_command_time (int);
26
27extern void set_per_command_space (int);
28
62e77f56
CB
29extern bool worker_threads_disabled ();
30
1e3b796d
TT
31/* Records a run time and space usage to be used as a base for
32 reporting elapsed time or change in space. */
33
34class scoped_command_stats
35{
36 public:
37
38 explicit scoped_command_stats (bool msg_type);
39 ~scoped_command_stats ();
40
41 private:
42
3847a7bf
TT
43 DISABLE_COPY_AND_ASSIGN (scoped_command_stats);
44
45 /* Print the time, along with a string. */
46 void print_time (const char *msg);
1e3b796d
TT
47
48 /* Zero if the saved time is from the beginning of GDB execution.
49 One if from the beginning of an individual command execution. */
50 bool m_msg_type;
51 /* Track whether the stat was enabled at the start of the command
52 so that we can avoid printing anything if it gets turned on by
53 the current command. */
54 int m_time_enabled : 1;
55 int m_space_enabled : 1;
56 int m_symtab_enabled : 1;
dcb07cfa
PA
57 run_time_clock::time_point m_start_cpu_time;
58 std::chrono::steady_clock::time_point m_start_wall_time;
1e3b796d
TT
59 long m_start_space;
60 /* Total number of symtabs (over all objfiles). */
61 int m_start_nr_symtabs;
62 /* A count of the compunits. */
63 int m_start_nr_compunit_symtabs;
64 /* Total number of blocks. */
65 int m_start_nr_blocks;
66};
bd712aed
DE
67
68#endif /* MAINT_H */
This page took 0.976215 seconds and 4 git commands to generate.