Deepak Panickal | 6f9c468 | 2014-05-16 10:51:01 +0000 | [diff] [blame] | 1 | //===-- 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 | //-- |
| 36 | CMICmdCmdSupportListFeatures::CMICmdCmdSupportListFeatures( void ) |
| 37 | { |
| 38 | // Command factory matches this name with that received from the stdin stream |
| 39 | m_strMiCmd = "list-features"; |
| 40 | |
Deepak Panickal | 877569c | 2014-06-24 16:35:50 +0000 | [diff] [blame^] | 41 | // Required by the CMICmdFactory when registering *this command |
Deepak Panickal | 6f9c468 | 2014-05-16 10:51:01 +0000 | [diff] [blame] | 42 | m_pSelfCreatorFn = &CMICmdCmdSupportListFeatures::CreateSelf; |
| 43 | } |
| 44 | |
| 45 | //++ ------------------------------------------------------------------------------------ |
| 46 | // Details: CMICmdCmdSupportListFeatures destructor. |
| 47 | // Type: Overrideable. |
| 48 | // Args: None. |
| 49 | // Return: None. |
| 50 | // Throws: None. |
| 51 | //-- |
| 52 | CMICmdCmdSupportListFeatures::~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 | //-- |
| 65 | bool 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 | //-- |
| 81 | bool CMICmdCmdSupportListFeatures::Acknowledge( void ) |
| 82 | { |
| 83 | const CMICmnMIValueConst miValueConst( "data-read-memory-bytes" ); |
| 84 | const CMICmnMIValueList miValueList( miValueConst ); |
| 85 | const CMICmnMIValueResult miValueResult( "features", miValueList ); |
Deepak Panickal | 877569c | 2014-06-24 16:35:50 +0000 | [diff] [blame^] | 86 | const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult ); |
Deepak Panickal | 6f9c468 | 2014-05-16 10:51:01 +0000 | [diff] [blame] | 87 | m_miResultRecord = miRecordResult; |
| 88 | |
| 89 | return MIstatus::success; |
| 90 | } |
| 91 | |
| 92 | //++ ------------------------------------------------------------------------------------ |
Deepak Panickal | 877569c | 2014-06-24 16:35:50 +0000 | [diff] [blame^] | 93 | // Details: Required by the CMICmdFactory when registering *this command. The factory |
Deepak Panickal | 6f9c468 | 2014-05-16 10:51:01 +0000 | [diff] [blame] | 94 | // 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 | //-- |
| 100 | CMICmdBase * CMICmdCmdSupportListFeatures::CreateSelf( void ) |
| 101 | { |
| 102 | return new CMICmdCmdSupportListFeatures(); |
Deepak Panickal | 877569c | 2014-06-24 16:35:50 +0000 | [diff] [blame^] | 103 | } |