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