]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdTrace.cpp
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdCmdTrace.cpp
1 //===-- MICmdCmdTrace.cpp ---------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // Overview:    CMICmdCmdTraceStatus    implementation.
10
11 // In-house headers:
12 #include "MICmdCmdTrace.h"
13 #include "MICmnMIResultRecord.h"
14 #include "MICmnMIValueConst.h"
15
16 //++
17 // Details: CMICmdCmdTraceStatus constructor.
18 // Type:    Method.
19 // Args:    None.
20 // Return:  None.
21 // Throws:  None.
22 //--
23 CMICmdCmdTraceStatus::CMICmdCmdTraceStatus() {
24   // Command factory matches this name with that received from the stdin stream
25   m_strMiCmd = "trace-status";
26
27   // Required by the CMICmdFactory when registering *this command
28   m_pSelfCreatorFn = &CMICmdCmdTraceStatus::CreateSelf;
29 }
30
31 //++
32 // Details: CMICmdCmdTraceStatus destructor.
33 // Type:    Overrideable.
34 // Args:    None.
35 // Return:  None.
36 // Throws:  None.
37 //--
38 CMICmdCmdTraceStatus::~CMICmdCmdTraceStatus() {}
39
40 //++
41 // Details: The invoker requires this function. The command does work in this
42 // function.
43 //          The command is likely to communicate with the LLDB SBDebugger in
44 //          here.
45 // Type:    Overridden.
46 // Args:    None.
47 // Return:  MIstatus::success - Functional succeeded.
48 //          MIstatus::failure - Functional failed.
49 // Throws:  None.
50 //--
51 bool CMICmdCmdTraceStatus::Execute() {
52   // Do nothing
53   return MIstatus::success;
54 }
55
56 //++
57 // Details: The invoker requires this function. The command prepares a MI Record
58 // Result
59 //          for the work carried out in the Execute().
60 // Type:    Overridden.
61 // Args:    None.
62 // Return:  MIstatus::success - Functional succeeded.
63 //          MIstatus::failure - Functional failed.
64 // Throws:  None.
65 //--
66 bool CMICmdCmdTraceStatus::Acknowledge() {
67   const CMICmnMIValueConst miValueConst(MIRSRC(IDS_CMD_ERR_NOT_IMPLEMENTED));
68   const CMICmnMIValueResult miValueResult("msg", miValueConst);
69   const CMICmnMIResultRecord miRecordResult(
70       m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
71       miValueResult);
72   m_miResultRecord = miRecordResult;
73
74   return MIstatus::success;
75 }
76
77 //++
78 // Details: Required by the CMICmdFactory when registering *this command. The
79 // factory
80 //          calls this function to create an instance of *this command.
81 // Type:    Static method.
82 // Args:    None.
83 // Return:  CMICmdBase * - Pointer to a new command.
84 // Throws:  None.
85 //--
86 CMICmdBase *CMICmdCmdTraceStatus::CreateSelf() {
87   return new CMICmdCmdTraceStatus();
88 }