]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/tools/lldb-mi/MICmdCmdMiscellanous.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / tools / lldb-mi / MICmdCmdMiscellanous.h
1 //===-- MICmdCmdMiscellanous.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 // Overview:    CMICmdCmdGdbExit                interface.
10 //              CMICmdCmdListThreadGroups       interface.
11 //              CMICmdCmdInterpreterExec        interface.
12 //              CMICmdCmdInferiorTtySet         interface.
13 //
14 //              To implement new MI commands derive a new command class from the
15 //              command base
16 //              class. To enable the new command for interpretation add the new
17 //              command class
18 //              to the command factory. The files of relevance are:
19 //                  MICmdCommands.cpp
20 //                  MICmdBase.h / .cpp
21 //                  MICmdCmd.h / .cpp
22 //              For an introduction to adding a new command see
23 //              CMICmdCmdSupportInfoMiCmdQuery
24 //              command class as an example.
25
26 #pragma once
27
28 // Third party headers:
29 #include "lldb/API/SBCommandReturnObject.h"
30
31 // In-house headers:
32 #include "MICmdBase.h"
33 #include "MICmnMIValueList.h"
34 #include "MICmnMIValueTuple.h"
35
36 //++
37 //============================================================================
38 // Details: MI command class. MI commands derived from the command base class.
39 //          *this class implements MI command "gdb-exit".
40 //--
41 class CMICmdCmdGdbExit : public CMICmdBase {
42   // Statics:
43 public:
44   // Required by the CMICmdFactory when registering *this command
45   static CMICmdBase *CreateSelf();
46
47   // Methods:
48 public:
49   /* ctor */ CMICmdCmdGdbExit();
50
51   // Overridden:
52 public:
53   // From CMICmdInvoker::ICmd
54   bool Execute() override;
55   bool Acknowledge() override;
56   // From CMICmnBase
57   /* dtor */ ~CMICmdCmdGdbExit() override;
58 };
59
60 //++
61 //============================================================================
62 // Details: MI command class. MI commands derived from the command base class.
63 //          *this class implements MI command "list-thread-groups".
64 //          This command does not follow the MI documentation exactly.
65 //          http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Miscellaneous-Commands.html#GDB_002fMI-Miscellaneous-Commands
66 //--
67 class CMICmdCmdListThreadGroups : public CMICmdBase {
68   // Statics:
69 public:
70   // Required by the CMICmdFactory when registering *this command
71   static CMICmdBase *CreateSelf();
72
73   // Methods:
74 public:
75   /* ctor */ CMICmdCmdListThreadGroups();
76
77   // Overridden:
78 public:
79   // From CMICmdInvoker::ICmd
80   bool Execute() override;
81   bool Acknowledge() override;
82   bool ParseArgs() override;
83   // From CMICmnBase
84   /* dtor */ ~CMICmdCmdListThreadGroups() override;
85
86   // Typedefs:
87 private:
88   typedef std::vector<CMICmnMIValueTuple> VecMIValueTuple_t;
89
90   // Attributes:
91 private:
92   bool m_bIsI1; // True = Yes command argument equal "i1", false = no match
93   bool m_bHaveArgOption;  // True = Yes "--available" present, false = not found
94   bool m_bHaveArgRecurse; // True = Yes command argument "--recurse", false = no
95                           // found
96   VecMIValueTuple_t m_vecMIValueTuple;
97   const CMIUtilString m_constStrArgNamedAvailable;
98   const CMIUtilString m_constStrArgNamedRecurse;
99   const CMIUtilString m_constStrArgNamedGroup;
100   const CMIUtilString m_constStrArgNamedThreadGroup;
101 };
102
103 //++
104 //============================================================================
105 // Details: MI command class. MI commands derived from the command base class.
106 //          *this class implements MI command "interpreter-exec".
107 //--
108 class CMICmdCmdInterpreterExec : public CMICmdBase {
109   // Statics:
110 public:
111   // Required by the CMICmdFactory when registering *this command
112   static CMICmdBase *CreateSelf();
113
114   // Methods:
115 public:
116   /* ctor */ CMICmdCmdInterpreterExec();
117
118   // Overridden:
119 public:
120   // From CMICmdInvoker::ICmd
121   bool Execute() override;
122   bool Acknowledge() override;
123   bool ParseArgs() override;
124   // From CMICmnBase
125   /* dtor */ ~CMICmdCmdInterpreterExec() override;
126
127   // Attributes:
128 private:
129   const CMIUtilString m_constStrArgNamedInterpreter;
130   const CMIUtilString m_constStrArgNamedCommand;
131   lldb::SBCommandReturnObject m_lldbResult;
132 };
133
134 //++
135 //============================================================================
136 // Details: MI command class. MI commands derived from the command base class.
137 //          *this class implements MI command "inferior-tty-set".
138 //--
139 class CMICmdCmdInferiorTtySet : public CMICmdBase {
140   // Statics:
141 public:
142   // Required by the CMICmdFactory when registering *this command
143   static CMICmdBase *CreateSelf();
144
145   // Methods:
146 public:
147   /* ctor */ CMICmdCmdInferiorTtySet();
148
149   // Overridden:
150 public:
151   // From CMICmdInvoker::ICmd
152   bool Execute() override;
153   bool Acknowledge() override;
154   // From CMICmnBase
155   /* dtor */ ~CMICmdCmdInferiorTtySet() override;
156 };