1 //===-- MICmdCmdGdbThread.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: CMICmdCmdGdbThread implementation.
12 #include "MICmdCmdGdbThread.h"
13 #include "MICmnMIResultRecord.h"
14 #include "MICmnMIValueConst.h"
17 // Details: CMICmdCmdGdbThread constructor.
23 CMICmdCmdGdbThread::CMICmdCmdGdbThread() {
24 // Command factory matches this name with that received from the stdin stream
25 m_strMiCmd = "thread";
27 // Required by the CMICmdFactory when registering *this command
28 m_pSelfCreatorFn = &CMICmdCmdGdbThread::CreateSelf;
32 // Details: CMICmdCmdThread destructor.
33 // Type: Overrideable.
38 CMICmdCmdGdbThread::~CMICmdCmdGdbThread() {}
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 CMICmdCmdGdbThread::Execute() {
54 return MIstatus::success;
58 // Details: The invoker requires this function. The command prepares a MI Record
60 // for the work carried out in the Execute().
63 // Return: MIstatus::success - Functional succeeded.
64 // MIstatus::failure - Functional failed.
67 bool CMICmdCmdGdbThread::Acknowledge() {
68 const CMICmnMIValueConst miValueConst(MIRSRC(IDS_WORD_NOT_IMPLEMENTED));
69 const CMICmnMIValueResult miValueResult("msg", miValueConst);
70 const CMICmnMIResultRecord miRecordResult(
71 m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
73 m_miResultRecord = miRecordResult;
75 return MIstatus::success;
79 // Details: Required by the CMICmdFactory when registering *this command. The
81 // calls this function to create an instance of *this command.
82 // Type: Static method.
84 // Return: CMICmdBase * - Pointer to a new command.
87 CMICmdBase *CMICmdCmdGdbThread::CreateSelf() {
88 return new CMICmdCmdGdbThread();