1 //===-- MICmdCmdSupportList.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 //===----------------------------------------------------------------------===//
11 // File: MICmdCmdSupportList.cpp
13 // Overview: CMICmdCmdSupportListFeatures implementation.
15 // Environment: Compilers: Visual C++ 12.
16 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17 // Libraries: See MIReadmetxt.
23 #include "MICmdCmdSupportList.h"
24 #include "MICmnMIResultRecord.h"
25 #include "MICmnMIValueConst.h"
26 #include "MICmnMIValueList.h"
28 //++ ------------------------------------------------------------------------------------
29 // Details: CMICmdCmdSupportListFeatures constructor.
35 CMICmdCmdSupportListFeatures::CMICmdCmdSupportListFeatures(void)
37 // Command factory matches this name with that received from the stdin stream
38 m_strMiCmd = "list-features";
40 // Required by the CMICmdFactory when registering *this command
41 m_pSelfCreatorFn = &CMICmdCmdSupportListFeatures::CreateSelf;
44 //++ ------------------------------------------------------------------------------------
45 // Details: CMICmdCmdSupportListFeatures destructor.
46 // Type: Overrideable.
51 CMICmdCmdSupportListFeatures::~CMICmdCmdSupportListFeatures(void)
55 //++ ------------------------------------------------------------------------------------
56 // Details: The invoker requires this function. The command does work in this function.
57 // The command is likely to communicate with the LLDB SBDebugger in here.
60 // Return: MIstatus::success - Functional succeeded.
61 // MIstatus::failure - Functional failed.
65 CMICmdCmdSupportListFeatures::Execute(void)
69 return MIstatus::success;
72 //++ ------------------------------------------------------------------------------------
73 // Details: The invoker requires this function. The command prepares a MI Record Result
74 // for the work carried out in the Execute().
77 // Return: MIstatus::success - Functional succeeded.
78 // MIstatus::failure - Functional failed.
82 CMICmdCmdSupportListFeatures::Acknowledge(void)
84 const CMICmnMIValueConst miValueConst("data-read-memory-bytes");
85 const CMICmnMIValueList miValueList(miValueConst);
86 const CMICmnMIValueResult miValueResult("features", miValueList);
87 const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
88 m_miResultRecord = miRecordResult;
90 return MIstatus::success;
93 //++ ------------------------------------------------------------------------------------
94 // Details: Required by the CMICmdFactory when registering *this command. The factory
95 // calls this function to create an instance of *this command.
96 // Type: Static method.
98 // Return: CMICmdBase * - Pointer to a new command.
102 CMICmdCmdSupportListFeatures::CreateSelf(void)
104 return new CMICmdCmdSupportListFeatures();