xref: /freebsd/contrib/llvm-project/lldb/include/lldb/API/SBStatisticsOptions.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1 //===-- SBStatisticsOptions.h -----------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_API_SBSTATISTICSOPTIONS_H
10 #define LLDB_API_SBSTATISTICSOPTIONS_H
11 
12 #include "lldb/API/SBDefines.h"
13 
14 namespace lldb {
15 
16 /// This class handles the verbosity when dumping statistics
17 class LLDB_API SBStatisticsOptions {
18 public:
19   SBStatisticsOptions();
20   SBStatisticsOptions(const lldb::SBStatisticsOptions &rhs);
21   ~SBStatisticsOptions();
22 
23   const SBStatisticsOptions &operator=(const lldb::SBStatisticsOptions &rhs);
24 
25   /// If true, dump only high-level summary statistics. Exclude details like
26   /// targets, modules, breakpoints, etc. This turns off `IncludeTargets`,
27   /// `IncludeModules` and `IncludeTranscript` by default.
28   ///
29   /// Defaults to false.
30   void SetSummaryOnly(bool b);
31   bool GetSummaryOnly();
32 
33   /// If true, dump statistics for the targets, including breakpoints,
34   /// expression evaluations, frame variables, etc.
35   ///
36   /// Defaults to true, unless the `SummaryOnly` mode is enabled, in which case
37   /// this is turned off unless specified.
38   ///
39   /// If both `IncludeTargets` and `IncludeModules` are true, a list of module
40   /// identifiers will be added to the "targets" section.
41   void SetIncludeTargets(bool b);
42   bool GetIncludeTargets() const;
43 
44   /// If true, dump statistics for the modules, including time and size of
45   /// various aspects of the module and debug information, type system, path,
46   /// etc.
47   ///
48   /// Defaults to true, unless the `SummaryOnly` mode is enabled, in which case
49   /// this is turned off unless specified.
50   ///
51   /// If both `IncludeTargets` and `IncludeModules` are true, a list of module
52   /// identifiers will be added to the "targets" section.
53   void SetIncludeModules(bool b);
54   bool GetIncludeModules() const;
55 
56   /// If true and the setting `interpreter.save-transcript` is enabled, include
57   /// a JSON array with all commands the user and/or scripts executed during a
58   /// debug session.
59   ///
60   /// Defaults to true, unless the `SummaryOnly` mode is enabled, in which case
61   /// this is turned off unless specified.
62   void SetIncludeTranscript(bool b);
63   bool GetIncludeTranscript() const;
64 
65   /// If set to true, the debugger will load all debug info that is available
66   /// and report statistics on the total amount. If this is set to false, then
67   /// only report statistics on the currently loaded debug information.
68   /// This can avoid loading debug info from separate files just so it can
69   /// report the total size which can slow down statistics reporting.
70   void SetReportAllAvailableDebugInfo(bool b);
71   bool GetReportAllAvailableDebugInfo();
72 
73 protected:
74   friend class SBTarget;
75   const lldb_private::StatisticsOptions &ref() const;
76 
77 private:
78   std::unique_ptr<lldb_private::StatisticsOptions> m_opaque_up;
79 };
80 } // namespace lldb
81 #endif // LLDB_API_SBSTATISTICSOPTIONS_H
82