1 //===-- MICmdCmdMiscellanous.h ----------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // Overview: CMICmdCmdGdbExit interface.
10 // CMICmdCmdListThreadGroups interface.
11 // CMICmdCmdInterpreterExec interface.
12 // CMICmdCmdInferiorTtySet interface.
14 // To implement new MI commands derive a new command class from the
16 // class. To enable the new command for interpretation add the new
18 // to the command factory. The files of relevance are:
22 // For an introduction to adding a new command see
23 // CMICmdCmdSupportInfoMiCmdQuery
24 // command class as an example.
28 // Third party headers:
29 #include "lldb/API/SBCommandReturnObject.h"
32 #include "MICmdBase.h"
33 #include "MICmnMIValueList.h"
34 #include "MICmnMIValueTuple.h"
37 //============================================================================
38 // Details: MI command class. MI commands derived from the command base class.
39 // *this class implements MI command "gdb-exit".
41 class CMICmdCmdGdbExit : public CMICmdBase {
44 // Required by the CMICmdFactory when registering *this command
45 static CMICmdBase *CreateSelf();
49 /* ctor */ CMICmdCmdGdbExit();
53 // From CMICmdInvoker::ICmd
54 bool Execute() override;
55 bool Acknowledge() override;
57 /* dtor */ ~CMICmdCmdGdbExit() override;
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
67 class CMICmdCmdListThreadGroups : public CMICmdBase {
70 // Required by the CMICmdFactory when registering *this command
71 static CMICmdBase *CreateSelf();
75 /* ctor */ CMICmdCmdListThreadGroups();
79 // From CMICmdInvoker::ICmd
80 bool Execute() override;
81 bool Acknowledge() override;
82 bool ParseArgs() override;
84 /* dtor */ ~CMICmdCmdListThreadGroups() override;
88 typedef std::vector<CMICmnMIValueTuple> VecMIValueTuple_t;
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
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;
104 //============================================================================
105 // Details: MI command class. MI commands derived from the command base class.
106 // *this class implements MI command "interpreter-exec".
108 class CMICmdCmdInterpreterExec : public CMICmdBase {
111 // Required by the CMICmdFactory when registering *this command
112 static CMICmdBase *CreateSelf();
116 /* ctor */ CMICmdCmdInterpreterExec();
120 // From CMICmdInvoker::ICmd
121 bool Execute() override;
122 bool Acknowledge() override;
123 bool ParseArgs() override;
125 /* dtor */ ~CMICmdCmdInterpreterExec() override;
129 const CMIUtilString m_constStrArgNamedInterpreter;
130 const CMIUtilString m_constStrArgNamedCommand;
131 lldb::SBCommandReturnObject m_lldbResult;
135 //============================================================================
136 // Details: MI command class. MI commands derived from the command base class.
137 // *this class implements MI command "inferior-tty-set".
139 class CMICmdCmdInferiorTtySet : public CMICmdBase {
142 // Required by the CMICmdFactory when registering *this command
143 static CMICmdBase *CreateSelf();
147 /* ctor */ CMICmdCmdInferiorTtySet();
151 // From CMICmdInvoker::ICmd
152 bool Execute() override;
153 bool Acknowledge() override;
155 /* dtor */ ~CMICmdCmdInferiorTtySet() override;