blob: c78aa53876ae597ad17c16aef18f8ddef37b932b [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
10//++
11// File: MICmdCmdSupportList.cpp
12//
13// Overview: CMICmdCmdSupportListFeatures implementation.
14//
15// Environment: Compilers: Visual C++ 12.
16// gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17// Libraries: See MIReadmetxt.
18//
19// Copyright: None.
20//--
21
22// In-house headers:
23#include "MICmnConfig.h"
24#include "MICmdCmdSupportList.h"
25#include "MICmnMIResultRecord.h"
26#include "MICmnMIValueConst.h"
27#include "MICmnMIValueList.h"
28
29//++ ------------------------------------------------------------------------------------
30// Details: CMICmdCmdSupportListFeatures constructor.
31// Type: Method.
32// Args: None.
33// Return: None.
34// Throws: None.
35//--
36CMICmdCmdSupportListFeatures::CMICmdCmdSupportListFeatures( void )
37{
38 // Command factory matches this name with that received from the stdin stream
39 m_strMiCmd = "list-features";
40
Deepak Panickal877569c2014-06-24 16:35:50 +000041 // Required by the CMICmdFactory when registering *this command
Deepak Panickal6f9c4682014-05-16 10:51:01 +000042 m_pSelfCreatorFn = &CMICmdCmdSupportListFeatures::CreateSelf;
43}
44
45//++ ------------------------------------------------------------------------------------
46// Details: CMICmdCmdSupportListFeatures destructor.
47// Type: Overrideable.
48// Args: None.
49// Return: None.
50// Throws: None.
51//--
52CMICmdCmdSupportListFeatures::~CMICmdCmdSupportListFeatures( void )
53{
54}
55
56//++ ------------------------------------------------------------------------------------
57// Details: The invoker requires this function. The command does work in this function.
58// The command is likely to communicate with the LLDB SBDebugger in here.
59// Type: Overridden.
60// Args: None.
61// Return: MIstatus::success - Functional succeeded.
62// MIstatus::failure - Functional failed.
63// Throws: None.
64//--
65bool CMICmdCmdSupportListFeatures::Execute( void )
66{
67 // Do nothing
68
69 return MIstatus::success;
70}
71
72//++ ------------------------------------------------------------------------------------
73// Details: The invoker requires this function. The command prepares a MI Record Result
74// for the work carried out in the Execute().
75// Type: Overridden.
76// Args: None.
77// Return: MIstatus::success - Functional succeeded.
78// MIstatus::failure - Functional failed.
79// Throws: None.
80//--
81bool CMICmdCmdSupportListFeatures::Acknowledge( void )
82{
83 const CMICmnMIValueConst miValueConst( "data-read-memory-bytes" );
84 const CMICmnMIValueList miValueList( miValueConst );
85 const CMICmnMIValueResult miValueResult( "features", miValueList );
Deepak Panickal877569c2014-06-24 16:35:50 +000086 const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult );
Deepak Panickal6f9c4682014-05-16 10:51:01 +000087 m_miResultRecord = miRecordResult;
88
89 return MIstatus::success;
90}
91
92//++ ------------------------------------------------------------------------------------
Deepak Panickal877569c2014-06-24 16:35:50 +000093// Details: Required by the CMICmdFactory when registering *this command. The factory
Deepak Panickal6f9c4682014-05-16 10:51:01 +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.
99//--
100CMICmdBase * CMICmdCmdSupportListFeatures::CreateSelf( void )
101{
102 return new CMICmdCmdSupportListFeatures();
Deepak Panickal877569c2014-06-24 16:35:50 +0000103}