]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/lldb-mi/MICmdCmdSupportList.cpp
Import LLDB as of upstream SVN 241361 (git 612c075f)
[FreeBSD/FreeBSD.git] / tools / lldb-mi / MICmdCmdSupportList.cpp
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 // Overview:    CMICmdCmdSupportListFeatures            implementation.
11
12 // In-house headers:
13 #include "MICmdCmdSupportList.h"
14 #include "MICmnMIResultRecord.h"
15 #include "MICmnMIValueConst.h"
16 #include "MICmnMIValueList.h"
17
18 //++ ------------------------------------------------------------------------------------
19 // Details: CMICmdCmdSupportListFeatures constructor.
20 // Type:    Method.
21 // Args:    None.
22 // Return:  None.
23 // Throws:  None.
24 //--
25 CMICmdCmdSupportListFeatures::CMICmdCmdSupportListFeatures(void)
26 {
27     // Command factory matches this name with that received from the stdin stream
28     m_strMiCmd = "list-features";
29
30     // Required by the CMICmdFactory when registering *this command
31     m_pSelfCreatorFn = &CMICmdCmdSupportListFeatures::CreateSelf;
32 }
33
34 //++ ------------------------------------------------------------------------------------
35 // Details: CMICmdCmdSupportListFeatures destructor.
36 // Type:    Overrideable.
37 // Args:    None.
38 // Return:  None.
39 // Throws:  None.
40 //--
41 CMICmdCmdSupportListFeatures::~CMICmdCmdSupportListFeatures(void)
42 {
43 }
44
45 //++ ------------------------------------------------------------------------------------
46 // Details: The invoker requires this function. The command does work in this function.
47 //          The command is likely to communicate with the LLDB SBDebugger in here.
48 // Type:    Overridden.
49 // Args:    None.
50 // Return:  MIstatus::success - Functional succeeded.
51 //          MIstatus::failure - Functional failed.
52 // Throws:  None.
53 //--
54 bool
55 CMICmdCmdSupportListFeatures::Execute(void)
56 {
57     // Do nothing
58
59     return MIstatus::success;
60 }
61
62 //++ ------------------------------------------------------------------------------------
63 // Details: The invoker requires this function. The command prepares a MI Record Result
64 //          for the work carried out in the Execute().
65 // Type:    Overridden.
66 // Args:    None.
67 // Return:  MIstatus::success - Functional succeeded.
68 //          MIstatus::failure - Functional failed.
69 // Throws:  None.
70 //--
71 bool
72 CMICmdCmdSupportListFeatures::Acknowledge(void)
73 {
74     const CMICmnMIValueConst miValueConst("data-read-memory-bytes");
75     const CMICmnMIValueList miValueList(miValueConst);
76     const CMICmnMIValueResult miValueResult("features", miValueList);
77     const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
78     m_miResultRecord = miRecordResult;
79
80     return MIstatus::success;
81 }
82
83 //++ ------------------------------------------------------------------------------------
84 // Details: Required by the CMICmdFactory when registering *this command. The factory
85 //          calls this function to create an instance of *this command.
86 // Type:    Static method.
87 // Args:    None.
88 // Return:  CMICmdBase * - Pointer to a new command.
89 // Throws:  None.
90 //--
91 CMICmdBase *
92 CMICmdCmdSupportListFeatures::CreateSelf(void)
93 {
94     return new CMICmdCmdSupportListFeatures();
95 }