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: |
Deepak Panickal | 6f9c468 | 2014-05-16 10:51:01 +0000 | [diff] [blame] | 23 | #include "MICmdCmdSupportList.h" |
| 24 | #include "MICmnMIResultRecord.h" |
| 25 | #include "MICmnMIValueConst.h" |
| 26 | #include "MICmnMIValueList.h" |
| 27 | |
| 28 | //++ ------------------------------------------------------------------------------------ |
| 29 | // Details: CMICmdCmdSupportListFeatures constructor. |
| 30 | // Type: Method. |
| 31 | // Args: None. |
| 32 | // Return: None. |
| 33 | // Throws: None. |
| 34 | //-- |
| 35 | CMICmdCmdSupportListFeatures::CMICmdCmdSupportListFeatures( void ) |
| 36 | { |
| 37 | // Command factory matches this name with that received from the stdin stream |
| 38 | m_strMiCmd = "list-features"; |
| 39 | |
Deepak Panickal | 877569c | 2014-06-24 16:35:50 +0000 | [diff] [blame] | 40 | // Required by the CMICmdFactory when registering *this command |
Deepak Panickal | 6f9c468 | 2014-05-16 10:51:01 +0000 | [diff] [blame] | 41 | m_pSelfCreatorFn = &CMICmdCmdSupportListFeatures::CreateSelf; |
| 42 | } |
| 43 | |
| 44 | //++ ------------------------------------------------------------------------------------ |
| 45 | // Details: CMICmdCmdSupportListFeatures destructor. |
| 46 | // Type: Overrideable. |
| 47 | // Args: None. |
| 48 | // Return: None. |
| 49 | // Throws: None. |
| 50 | //-- |
| 51 | CMICmdCmdSupportListFeatures::~CMICmdCmdSupportListFeatures( void ) |
| 52 | { |
| 53 | } |
| 54 | |
| 55 | //++ ------------------------------------------------------------------------------------ |
| 56 | // Details: The invoker requires this function. The command does work in this function. |
| 57 | // The command is likely to communicate with the LLDB SBDebugger in here. |
| 58 | // Type: Overridden. |
| 59 | // Args: None. |
| 60 | // Return: MIstatus::success - Functional succeeded. |
| 61 | // MIstatus::failure - Functional failed. |
| 62 | // Throws: None. |
| 63 | //-- |
| 64 | bool CMICmdCmdSupportListFeatures::Execute( void ) |
| 65 | { |
| 66 | // Do nothing |
| 67 | |
| 68 | return MIstatus::success; |
| 69 | } |
| 70 | |
| 71 | //++ ------------------------------------------------------------------------------------ |
| 72 | // Details: The invoker requires this function. The command prepares a MI Record Result |
| 73 | // for the work carried out in the Execute(). |
| 74 | // Type: Overridden. |
| 75 | // Args: None. |
| 76 | // Return: MIstatus::success - Functional succeeded. |
| 77 | // MIstatus::failure - Functional failed. |
| 78 | // Throws: None. |
| 79 | //-- |
| 80 | bool CMICmdCmdSupportListFeatures::Acknowledge( void ) |
| 81 | { |
| 82 | const CMICmnMIValueConst miValueConst( "data-read-memory-bytes" ); |
| 83 | const CMICmnMIValueList miValueList( miValueConst ); |
| 84 | const CMICmnMIValueResult miValueResult( "features", miValueList ); |
Deepak Panickal | 877569c | 2014-06-24 16:35:50 +0000 | [diff] [blame] | 85 | const CMICmnMIResultRecord miRecordResult( m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult ); |
Deepak Panickal | 6f9c468 | 2014-05-16 10:51:01 +0000 | [diff] [blame] | 86 | m_miResultRecord = miRecordResult; |
| 87 | |
| 88 | return MIstatus::success; |
| 89 | } |
| 90 | |
| 91 | //++ ------------------------------------------------------------------------------------ |
Deepak Panickal | 877569c | 2014-06-24 16:35:50 +0000 | [diff] [blame] | 92 | // Details: Required by the CMICmdFactory when registering *this command. The factory |
Deepak Panickal | 6f9c468 | 2014-05-16 10:51:01 +0000 | [diff] [blame] | 93 | // calls this function to create an instance of *this command. |
| 94 | // Type: Static method. |
| 95 | // Args: None. |
| 96 | // Return: CMICmdBase * - Pointer to a new command. |
| 97 | // Throws: None. |
| 98 | //-- |
| 99 | CMICmdBase * CMICmdCmdSupportListFeatures::CreateSelf( void ) |
| 100 | { |
| 101 | return new CMICmdCmdSupportListFeatures(); |
Deepak Panickal | 877569c | 2014-06-24 16:35:50 +0000 | [diff] [blame] | 102 | } |