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