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 //===----------------------------------------------------------------------===//
10 // Overview: CMICmdCmdSupportListFeatures implementation.
13 #include "MICmdCmdSupportList.h"
14 #include "MICmnMIResultRecord.h"
15 #include "MICmnMIValueConst.h"
16 #include "MICmnMIValueList.h"
18 //++ ------------------------------------------------------------------------------------
19 // Details: CMICmdCmdSupportListFeatures constructor.
25 CMICmdCmdSupportListFeatures::CMICmdCmdSupportListFeatures(void)
27 // Command factory matches this name with that received from the stdin stream
28 m_strMiCmd = "list-features";
30 // Required by the CMICmdFactory when registering *this command
31 m_pSelfCreatorFn = &CMICmdCmdSupportListFeatures::CreateSelf;
34 //++ ------------------------------------------------------------------------------------
35 // Details: CMICmdCmdSupportListFeatures destructor.
36 // Type: Overrideable.
41 CMICmdCmdSupportListFeatures::~CMICmdCmdSupportListFeatures(void)
45 //++ ------------------------------------------------------------------------------------
46 // Details: The invoker requires this function. The command does work in this function.
47 // The command is likely to communicate with the LLDB SBDebugger in here.
50 // Return: MIstatus::success - Functional succeeded.
51 // MIstatus::failure - Functional failed.
55 CMICmdCmdSupportListFeatures::Execute(void)
59 return MIstatus::success;
62 //++ ------------------------------------------------------------------------------------
63 // Details: The invoker requires this function. The command prepares a MI Record Result
64 // for the work carried out in the Execute().
67 // Return: MIstatus::success - Functional succeeded.
68 // MIstatus::failure - Functional failed.
72 CMICmdCmdSupportListFeatures::Acknowledge(void)
74 const CMICmnMIValueConst miValueConst("data-read-memory-bytes");
75 const CMICmnMIValueList miValueList(miValueConst);
76 const CMICmnMIValueResult miValueResult("features", miValueList);
77 const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
78 m_miResultRecord = miRecordResult;
80 return MIstatus::success;
83 //++ ------------------------------------------------------------------------------------
84 // Details: Required by the CMICmdFactory when registering *this command. The factory
85 // calls this function to create an instance of *this command.
86 // Type: Static method.
88 // Return: CMICmdBase * - Pointer to a new command.
92 CMICmdCmdSupportListFeatures::CreateSelf(void)
94 return new CMICmdCmdSupportListFeatures();