1 //===-- MICmdCmd.cpp --------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
13 // Overview: CMICmdCmdEnablePrettyPrinting implementation.
14 // CMICmdCmdSource implementation.
16 // Environment: Compilers: Visual C++ 12.
17 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
18 // Libraries: See MIReadmetxt.
26 //++ ------------------------------------------------------------------------------------
27 // Details: CMICmdCmdEnablePrettyPrinting constructor.
33 CMICmdCmdEnablePrettyPrinting::CMICmdCmdEnablePrettyPrinting(void)
35 // Command factory matches this name with that received from the stdin stream
36 m_strMiCmd = "enable-pretty-printing";
38 // Required by the CMICmdFactory when registering *this command
39 m_pSelfCreatorFn = &CMICmdCmdEnablePrettyPrinting::CreateSelf;
42 //++ ------------------------------------------------------------------------------------
43 // Details: CMICmdCmdEnablePrettyPrinting destructor.
44 // Type: Overrideable.
49 CMICmdCmdEnablePrettyPrinting::~CMICmdCmdEnablePrettyPrinting(void)
53 //++ ------------------------------------------------------------------------------------
54 // Details: The invoker requires this function. The command does work in this function.
55 // The command is likely to communicate with the LLDB SBDebugger in here.
58 // Return: MIstatus::success - Functional succeeded.
59 // MIstatus::failure - Functional failed.
63 CMICmdCmdEnablePrettyPrinting::Execute(void)
66 return MIstatus::success;
69 //++ ------------------------------------------------------------------------------------
70 // Details: The invoker requires this function. The command prepares a MI Record Result
71 // for the work carried out in the Execute().
74 // Return: MIstatus::success - Functional succeeded.
75 // MIstatus::failure - Functional failed.
79 CMICmdCmdEnablePrettyPrinting::Acknowledge(void)
81 const CMICmnMIValueConst miValueConst("0");
82 const CMICmnMIValueResult miValueResult("supported", miValueConst);
83 const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
84 m_miResultRecord = miRecordResult;
86 return MIstatus::success;
89 //++ ------------------------------------------------------------------------------------
90 // Details: Required by the CMICmdFactory when registering *this command. The factory
91 // calls this function to create an instance of *this command.
92 // Type: Static method.
94 // Return: CMICmdBase * - Pointer to a new command.
98 CMICmdCmdEnablePrettyPrinting::CreateSelf(void)
100 return new CMICmdCmdEnablePrettyPrinting();
103 //---------------------------------------------------------------------------------------
104 //---------------------------------------------------------------------------------------
105 //---------------------------------------------------------------------------------------
107 //++ ------------------------------------------------------------------------------------
108 // Details: CMICmdCmdSource constructor.
114 CMICmdCmdSource::CMICmdCmdSource(void)
116 // Command factory matches this name with that received from the stdin stream
117 m_strMiCmd = "source";
119 // Required by the CMICmdFactory when registering *this command
120 m_pSelfCreatorFn = &CMICmdCmdSource::CreateSelf;
123 //++ ------------------------------------------------------------------------------------
124 // Details: CMICmdCmdSource destructor.
125 // Type: Overrideable.
130 CMICmdCmdSource::~CMICmdCmdSource(void)
134 //++ ------------------------------------------------------------------------------------
135 // Details: The invoker requires this function. The command does work in this function.
136 // The command is likely to communicate with the LLDB SBDebugger in here.
139 // Return: MIstatus::success - Functional succeeded.
140 // MIstatus::failure - Functional failed.
144 CMICmdCmdSource::Execute(void)
147 return MIstatus::success;
150 //++ ------------------------------------------------------------------------------------
151 // Details: The invoker requires this function. The command prepares a MI Record Result
152 // for the work carried out in the Execute().
155 // Return: MIstatus::success - Functional succeeded.
156 // MIstatus::failure - Functional failed.
160 CMICmdCmdSource::Acknowledge(void)
162 const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done);
163 m_miResultRecord = miRecordResult;
165 return MIstatus::success;
168 //++ ------------------------------------------------------------------------------------
169 // Details: Required by the CMICmdFactory when registering *this command. The factory
170 // calls this function to create an instance of *this command.
171 // Type: Static method.
173 // Return: CMICmdBase * - Pointer to a new command.
177 CMICmdCmdSource::CreateSelf(void)
179 return new CMICmdCmdSource();