blob: c3a9c9ad257a9f15089f3623d1957df2a68351cb [file] [log] [blame]
Deepak Panickal6f9c4682014-05-16 10:51:01 +00001//===-- MICmdCmdSupportList.cpp ---------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Zachary Turner1d6af022014-11-17 18:06:21 +000010// Overview: CMICmdCmdSupportListFeatures implementation.
Deepak Panickal6f9c4682014-05-16 10:51:01 +000011
12// In-house headers:
Deepak Panickal6f9c4682014-05-16 10:51:01 +000013#include "MICmdCmdSupportList.h"
14#include "MICmnMIResultRecord.h"
15#include "MICmnMIValueConst.h"
16#include "MICmnMIValueList.h"
17
Kate Stoneb9c1b512016-09-06 20:57:50 +000018//++
19//------------------------------------------------------------------------------------
Zachary Turner1d6af022014-11-17 18:06:21 +000020// Details: CMICmdCmdSupportListFeatures constructor.
21// Type: Method.
22// Args: None.
23// Return: None.
24// Throws: None.
Deepak Panickal6f9c4682014-05-16 10:51:01 +000025//--
Kate Stoneb9c1b512016-09-06 20:57:50 +000026CMICmdCmdSupportListFeatures::CMICmdCmdSupportListFeatures() {
27 // Command factory matches this name with that received from the stdin stream
28 m_strMiCmd = "list-features";
Zachary Turner1d6af022014-11-17 18:06:21 +000029
Kate Stoneb9c1b512016-09-06 20:57:50 +000030 // Required by the CMICmdFactory when registering *this command
31 m_pSelfCreatorFn = &CMICmdCmdSupportListFeatures::CreateSelf;
Deepak Panickal6f9c4682014-05-16 10:51:01 +000032}
33
Kate Stoneb9c1b512016-09-06 20:57:50 +000034//++
35//------------------------------------------------------------------------------------
Zachary Turner1d6af022014-11-17 18:06:21 +000036// Details: CMICmdCmdSupportListFeatures destructor.
37// Type: Overrideable.
38// Args: None.
39// Return: None.
40// Throws: None.
Deepak Panickal6f9c4682014-05-16 10:51:01 +000041//--
Kate Stoneb9c1b512016-09-06 20:57:50 +000042CMICmdCmdSupportListFeatures::~CMICmdCmdSupportListFeatures() {}
Deepak Panickal6f9c4682014-05-16 10:51:01 +000043
Kate Stoneb9c1b512016-09-06 20:57:50 +000044//++
45//------------------------------------------------------------------------------------
46// Details: The invoker requires this function. The command does work in this
47// function.
48// The command is likely to communicate with the LLDB SBDebugger in
49// here.
Zachary Turner1d6af022014-11-17 18:06:21 +000050// Type: Overridden.
51// Args: None.
52// Return: MIstatus::success - Functional succeeded.
53// MIstatus::failure - Functional failed.
54// Throws: None.
Deepak Panickal6f9c4682014-05-16 10:51:01 +000055//--
Kate Stoneb9c1b512016-09-06 20:57:50 +000056bool CMICmdCmdSupportListFeatures::Execute() {
57 // Do nothing
Zachary Turner1d6af022014-11-17 18:06:21 +000058
Kate Stoneb9c1b512016-09-06 20:57:50 +000059 return MIstatus::success;
Deepak Panickal6f9c4682014-05-16 10:51:01 +000060}
61
Kate Stoneb9c1b512016-09-06 20:57:50 +000062//++
63//------------------------------------------------------------------------------------
64// Details: The invoker requires this function. The command prepares a MI Record
65// Result
Zachary Turner1d6af022014-11-17 18:06:21 +000066// for the work carried out in the Execute().
67// Type: Overridden.
68// Args: None.
69// Return: MIstatus::success - Functional succeeded.
70// MIstatus::failure - Functional failed.
71// Throws: None.
Deepak Panickal6f9c4682014-05-16 10:51:01 +000072//--
Kate Stoneb9c1b512016-09-06 20:57:50 +000073bool 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,
84 miValueResult);
85 m_miResultRecord = miRecordResult;
Deepak Panickal6f9c4682014-05-16 10:51:01 +000086
Kate Stoneb9c1b512016-09-06 20:57:50 +000087 return MIstatus::success;
Deepak Panickal6f9c4682014-05-16 10:51:01 +000088}
89
Kate Stoneb9c1b512016-09-06 20:57:50 +000090//++
91//------------------------------------------------------------------------------------
92// Details: Required by the CMICmdFactory when registering *this command. The
93// factory
Zachary Turner1d6af022014-11-17 18:06:21 +000094// calls this function to create an instance of *this command.
95// Type: Static method.
96// Args: None.
97// Return: CMICmdBase * - Pointer to a new command.
98// Throws: None.
Deepak Panickal6f9c4682014-05-16 10:51:01 +000099//--
Kate Stoneb9c1b512016-09-06 20:57:50 +0000100CMICmdBase *CMICmdCmdSupportListFeatures::CreateSelf() {
101 return new CMICmdCmdSupportListFeatures();
Deepak Panickal877569c2014-06-24 16:35:50 +0000102}