GDB (xrefs)
Loading...
Searching...
No Matches
gdb
maint.h
Go to the documentation of this file.
1
/* Support for GDB maintenance commands.
2
Copyright (C) 2013-2023 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 "gdbsupport/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
32
class
scoped_command_stats
33
{
34
public
:
35
36
explicit
scoped_command_stats
(
bool
msg_type);
37
~scoped_command_stats
();
38
39
private
:
40
41
DISABLE_COPY_AND_ASSIGN
(
scoped_command_stats
);
42
43
/* Print the time, along with a string. */
44
void
print_time
(
const
char
*msg);
45
46
/* Zero if the saved time is from the beginning of GDB execution.
47
One if from the beginning of an individual command execution. */
48
bool
m_msg_type
;
49
/* Track whether the stat was enabled at the start of the command
50
so that we can avoid printing anything if it gets turned on by
51
the current command. */
52
bool
m_time_enabled
: 1;
53
bool
m_space_enabled
: 1;
54
bool
m_symtab_enabled
: 1;
55
run_time_clock::time_point
m_start_cpu_time
;
56
std::chrono::steady_clock::time_point
m_start_wall_time
;
57
long
m_start_space
;
58
/* Total number of symtabs (over all objfiles). */
59
int
m_start_nr_symtabs
;
60
/* A count of the compunits. */
61
int
m_start_nr_compunit_symtabs
;
62
/* Total number of blocks. */
63
int
m_start_nr_blocks
;
64
};
65
66
extern
obj_section
*
maint_obj_section_from_bfd_section
(bfd *abfd,
67
asection *asection,
68
objfile
*ofile);
69
#endif
/* MAINT_H */
scoped_command_stats
Definition
maint.h:33
scoped_command_stats::m_start_nr_blocks
int m_start_nr_blocks
Definition
maint.h:63
scoped_command_stats::m_start_space
long m_start_space
Definition
maint.h:57
scoped_command_stats::m_start_wall_time
std::chrono::steady_clock::time_point m_start_wall_time
Definition
maint.h:56
scoped_command_stats::~scoped_command_stats
~scoped_command_stats()
Definition
maint.c:964
scoped_command_stats::DISABLE_COPY_AND_ASSIGN
DISABLE_COPY_AND_ASSIGN(scoped_command_stats)
scoped_command_stats::print_time
void print_time(const char *msg)
Definition
maint.c:1085
scoped_command_stats::m_space_enabled
bool m_space_enabled
Definition
maint.h:53
scoped_command_stats::m_start_cpu_time
run_time_clock::time_point m_start_cpu_time
Definition
maint.h:55
scoped_command_stats::m_start_nr_compunit_symtabs
int m_start_nr_compunit_symtabs
Definition
maint.h:61
scoped_command_stats::scoped_command_stats
scoped_command_stats(bool msg_type)
Definition
maint.c:1037
scoped_command_stats::m_start_nr_symtabs
int m_start_nr_symtabs
Definition
maint.h:59
scoped_command_stats::m_time_enabled
bool m_time_enabled
Definition
maint.h:52
scoped_command_stats::m_msg_type
bool m_msg_type
Definition
maint.h:48
scoped_command_stats::m_symtab_enabled
bool m_symtab_enabled
Definition
maint.h:54
set_per_command_space
void set_per_command_space(int)
Definition
maint.c:923
set_per_command_time
void set_per_command_time(int)
Definition
maint.c:914
maint_obj_section_from_bfd_section
obj_section * maint_obj_section_from_bfd_section(bfd *abfd, asection *asection, objfile *ofile)
Definition
maint.c:330
obj_section
Definition
objfiles.h:377
objfile
Definition
objfiles.h:422
Generated by
1.10.0