]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdGdbThread.cpp
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdCmdGdbThread.cpp
1 //===-- MICmdCmdGdbThread.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:    CMICmdCmdGdbThread      implementation.
10
11 // In-house headers:
12 #include "MICmdCmdGdbThread.h"
13 #include "MICmnMIResultRecord.h"
14 #include "MICmnMIValueConst.h"
15
16 //++
17 // Details: CMICmdCmdGdbThread constructor.
18 // Type:    Method.
19 // Args:    None.
20 // Return:  None.
21 // Throws:  None.
22 //--
23 CMICmdCmdGdbThread::CMICmdCmdGdbThread() {
24   // Command factory matches this name with that received from the stdin stream
25   m_strMiCmd = "thread";
26
27   // Required by the CMICmdFactory when registering *this command
28   m_pSelfCreatorFn = &CMICmdCmdGdbThread::CreateSelf;
29 }
30
31 //++
32 // Details: CMICmdCmdThread destructor.
33 // Type:    Overrideable.
34 // Args:    None.
35 // Return:  None.
36 // Throws:  None.
37 //--
38 CMICmdCmdGdbThread::~CMICmdCmdGdbThread() {}
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 CMICmdCmdGdbThread::Execute() {
52   // Do nothing
53
54   return MIstatus::success;
55 }
56
57 //++
58 // Details: The invoker requires this function. The command prepares a MI Record
59 // Result
60 //          for the work carried out in the Execute().
61 // Type:    Overridden.
62 // Args:    None.
63 // Return:  MIstatus::success - Functional succeeded.
64 //          MIstatus::failure - Functional failed.
65 // Throws:  None.
66 //--
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,
72       miValueResult);
73   m_miResultRecord = miRecordResult;
74
75   return MIstatus::success;
76 }
77
78 //++
79 // Details: Required by the CMICmdFactory when registering *this command. The
80 // factory
81 //          calls this function to create an instance of *this command.
82 // Type:    Static method.
83 // Args:    None.
84 // Return:  CMICmdBase * - Pointer to a new command.
85 // Throws:  None.
86 //--
87 CMICmdBase *CMICmdCmdGdbThread::CreateSelf() {
88   return new CMICmdCmdGdbThread();
89 }