1 //===-- MICmdCmdTrace.cpp ---------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // Overview: CMICmdCmdTraceStatus implementation.
12 #include "MICmdCmdTrace.h"
13 #include "MICmnMIResultRecord.h"
14 #include "MICmnMIValueConst.h"
17 // Details: CMICmdCmdTraceStatus constructor.
23 CMICmdCmdTraceStatus::CMICmdCmdTraceStatus() {
24 // Command factory matches this name with that received from the stdin stream
25 m_strMiCmd = "trace-status";
27 // Required by the CMICmdFactory when registering *this command
28 m_pSelfCreatorFn = &CMICmdCmdTraceStatus::CreateSelf;
32 // Details: CMICmdCmdTraceStatus destructor.
33 // Type: Overrideable.
38 CMICmdCmdTraceStatus::~CMICmdCmdTraceStatus() {}
41 // Details: The invoker requires this function. The command does work in this
43 // The command is likely to communicate with the LLDB SBDebugger in
47 // Return: MIstatus::success - Functional succeeded.
48 // MIstatus::failure - Functional failed.
51 bool CMICmdCmdTraceStatus::Execute() {
53 return MIstatus::success;
57 // Details: The invoker requires this function. The command prepares a MI Record
59 // for the work carried out in the Execute().
62 // Return: MIstatus::success - Functional succeeded.
63 // MIstatus::failure - Functional failed.
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,
72 m_miResultRecord = miRecordResult;
74 return MIstatus::success;
78 // Details: Required by the CMICmdFactory when registering *this command. The
80 // calls this function to create an instance of *this command.
81 // Type: Static method.
83 // Return: CMICmdBase * - Pointer to a new command.
86 CMICmdBase *CMICmdCmdTraceStatus::CreateSelf() {
87 return new CMICmdCmdTraceStatus();