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.
62 bool CMICmdCmdEnablePrettyPrinting::Execute( void )
65 return MIstatus::success;
68 //++ ------------------------------------------------------------------------------------
69 // Details: The invoker requires this function. The command prepares a MI Record Result
70 // for the work carried out in the Execute().
73 // Return: MIstatus::success - Functional succeeded.
74 // MIstatus::failure - Functional failed.
77 bool CMICmdCmdEnablePrettyPrinting::Acknowledge( void )
79 const CMICmnMIValueConst miValueConst( "0" );
80 const CMICmnMIValueResult miValueResult( "supported", miValueConst );
81 const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult );
82 m_miResultRecord = miRecordResult;
84 return MIstatus::success;
87 //++ ------------------------------------------------------------------------------------
88 // Details: Required by the CMICmdFactory when registering *this command. The factory
89 // calls this function to create an instance of *this command.
90 // Type: Static method.
92 // Return: CMICmdBase * - Pointer to a new command.
95 CMICmdBase * CMICmdCmdEnablePrettyPrinting::CreateSelf( void )
97 return new CMICmdCmdEnablePrettyPrinting();
100 //---------------------------------------------------------------------------------------
101 //---------------------------------------------------------------------------------------
102 //---------------------------------------------------------------------------------------
104 //++ ------------------------------------------------------------------------------------
105 // Details: CMICmdCmdSource constructor.
111 CMICmdCmdSource::CMICmdCmdSource( void )
113 // Command factory matches this name with that received from the stdin stream
114 m_strMiCmd = "source";
116 // Required by the CMICmdFactory when registering *this command
117 m_pSelfCreatorFn = &CMICmdCmdSource::CreateSelf;
120 //++ ------------------------------------------------------------------------------------
121 // Details: CMICmdCmdSource destructor.
122 // Type: Overrideable.
127 CMICmdCmdSource::~CMICmdCmdSource( void )
131 //++ ------------------------------------------------------------------------------------
132 // Details: The invoker requires this function. The command does work in this function.
133 // The command is likely to communicate with the LLDB SBDebugger in here.
136 // Return: MIstatus::success - Functional succeeded.
137 // MIstatus::failure - Functional failed.
140 bool CMICmdCmdSource::Execute( void )
143 return MIstatus::success;
146 //++ ------------------------------------------------------------------------------------
147 // Details: The invoker requires this function. The command prepares a MI Record Result
148 // for the work carried out in the Execute().
151 // Return: MIstatus::success - Functional succeeded.
152 // MIstatus::failure - Functional failed.
155 bool CMICmdCmdSource::Acknowledge( void )
157 const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done );
158 m_miResultRecord = miRecordResult;
160 return MIstatus::success;
163 //++ ------------------------------------------------------------------------------------
164 // Details: Required by the CMICmdFactory when registering *this command. The factory
165 // calls this function to create an instance of *this command.
166 // Type: Static method.
168 // Return: CMICmdBase * - Pointer to a new command.
171 CMICmdBase * CMICmdCmdSource::CreateSelf( void )
173 return new CMICmdCmdSource();