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"
19 //------------------------------------------------------------------------------------
20 // Details: CMICmdCmdSupportListFeatures constructor.
26 CMICmdCmdSupportListFeatures::CMICmdCmdSupportListFeatures() {
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;
35 //------------------------------------------------------------------------------------
36 // Details: CMICmdCmdSupportListFeatures destructor.
37 // Type: Overrideable.
42 CMICmdCmdSupportListFeatures::~CMICmdCmdSupportListFeatures() {}
45 //------------------------------------------------------------------------------------
46 // Details: The invoker requires this function. The command does work in this
48 // The command is likely to communicate with the LLDB SBDebugger in
52 // Return: MIstatus::success - Functional succeeded.
53 // MIstatus::failure - Functional failed.
56 bool CMICmdCmdSupportListFeatures::Execute() {
59 return MIstatus::success;
63 //------------------------------------------------------------------------------------
64 // Details: The invoker requires this function. The command prepares a MI Record
66 // for the work carried out in the Execute().
69 // Return: MIstatus::success - Functional succeeded.
70 // MIstatus::failure - Functional failed.
73 bool CMICmdCmdSupportListFeatures::Acknowledge() {
74 // Declare supported features here
75 const CMICmnMIValueConst miValueConst1("data-read-memory-bytes");
76 const CMICmnMIValueConst miValueConst2("exec-run-start-option");
77 // Some features may depend on host and/or target, decide what to add below
78 CMICmnMIValueList miValueList(true);
79 miValueList.Add(miValueConst1);
80 miValueList.Add(miValueConst2);
81 const CMICmnMIValueResult miValueResult("features", miValueList);
82 const CMICmnMIResultRecord miRecordResult(
83 m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done,
85 m_miResultRecord = miRecordResult;
87 return MIstatus::success;
91 //------------------------------------------------------------------------------------
92 // Details: Required by the CMICmdFactory when registering *this command. The
94 // calls this function to create an instance of *this command.
95 // Type: Static method.
97 // Return: CMICmdBase * - Pointer to a new command.
100 CMICmdBase *CMICmdCmdSupportListFeatures::CreateSelf() {
101 return new CMICmdCmdSupportListFeatures();