2014-05-16 18:51:01 +08:00
|
|
|
//===-- MICmdCmd.cpp --------------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-11-18 02:06:21 +08:00
|
|
|
// Overview: CMICmdCmdEnablePrettyPrinting implementation.
|
|
|
|
// CMICmdCmdSource implementation.
|
2014-05-16 18:51:01 +08:00
|
|
|
//
|
2015-03-17 02:18:18 +08:00
|
|
|
|
2014-05-16 18:51:01 +08:00
|
|
|
// In-house headers:
|
|
|
|
#include "MICmdCmd.h"
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
//++
|
|
|
|
//------------------------------------------------------------------------------------
|
2014-11-18 02:06:21 +08:00
|
|
|
// Details: CMICmdCmdEnablePrettyPrinting constructor.
|
|
|
|
// Type: Method.
|
|
|
|
// Args: None.
|
|
|
|
// Return: None.
|
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
CMICmdCmdEnablePrettyPrinting::CMICmdCmdEnablePrettyPrinting() {
|
|
|
|
// Command factory matches this name with that received from the stdin stream
|
|
|
|
m_strMiCmd = "enable-pretty-printing";
|
2014-11-18 02:06:21 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
// Required by the CMICmdFactory when registering *this command
|
|
|
|
m_pSelfCreatorFn = &CMICmdCmdEnablePrettyPrinting::CreateSelf;
|
2014-05-16 18:51:01 +08:00
|
|
|
}
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
//++
|
|
|
|
//------------------------------------------------------------------------------------
|
2014-11-18 02:06:21 +08:00
|
|
|
// Details: CMICmdCmdEnablePrettyPrinting destructor.
|
|
|
|
// Type: Overrideable.
|
|
|
|
// Args: None.
|
|
|
|
// Return: None.
|
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
CMICmdCmdEnablePrettyPrinting::~CMICmdCmdEnablePrettyPrinting() {}
|
|
|
|
|
|
|
|
//++
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// Details: The invoker requires this function. The command does work in this
|
|
|
|
// function.
|
|
|
|
// The command is likely to communicate with the LLDB SBDebugger in
|
|
|
|
// here.
|
2014-11-18 02:06:21 +08:00
|
|
|
// Type: Overridden.
|
|
|
|
// Args: None.
|
|
|
|
// Return: MIstatus::success - Functional succeeded.
|
|
|
|
// MIstatus::failure - Functional failed.
|
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
bool CMICmdCmdEnablePrettyPrinting::Execute() {
|
|
|
|
// Do nothing
|
|
|
|
return MIstatus::success;
|
2014-05-16 18:51:01 +08:00
|
|
|
}
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
//++
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// Details: The invoker requires this function. The command prepares a MI Record
|
|
|
|
// Result
|
2014-11-18 02:06:21 +08:00
|
|
|
// for the work carried out in the Execute().
|
|
|
|
// Type: Overridden.
|
|
|
|
// Args: None.
|
|
|
|
// Return: MIstatus::success - Functional succeeded.
|
|
|
|
// MIstatus::failure - Functional failed.
|
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
bool CMICmdCmdEnablePrettyPrinting::Acknowledge() {
|
|
|
|
const CMICmnMIValueConst miValueConst("0");
|
|
|
|
const CMICmnMIValueResult miValueResult("supported", miValueConst);
|
|
|
|
const CMICmnMIResultRecord miRecordResult(
|
|
|
|
m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done,
|
|
|
|
miValueResult);
|
|
|
|
m_miResultRecord = miRecordResult;
|
|
|
|
|
|
|
|
return MIstatus::success;
|
2014-05-16 18:51:01 +08:00
|
|
|
}
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
//++
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// Details: Required by the CMICmdFactory when registering *this command. The
|
|
|
|
// factory
|
2014-11-18 02:06:21 +08:00
|
|
|
// calls this function to create an instance of *this command.
|
|
|
|
// Type: Static method.
|
|
|
|
// Args: None.
|
|
|
|
// Return: CMICmdBase * - Pointer to a new command.
|
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
CMICmdBase *CMICmdCmdEnablePrettyPrinting::CreateSelf() {
|
|
|
|
return new CMICmdCmdEnablePrettyPrinting();
|
2014-05-16 18:51:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
//++
|
|
|
|
//------------------------------------------------------------------------------------
|
2014-11-18 02:06:21 +08:00
|
|
|
// Details: CMICmdCmdSource constructor.
|
|
|
|
// Type: Method.
|
|
|
|
// Args: None.
|
|
|
|
// Return: None.
|
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
CMICmdCmdSource::CMICmdCmdSource() {
|
|
|
|
// Command factory matches this name with that received from the stdin stream
|
|
|
|
m_strMiCmd = "source";
|
2014-11-18 02:06:21 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
// Required by the CMICmdFactory when registering *this command
|
|
|
|
m_pSelfCreatorFn = &CMICmdCmdSource::CreateSelf;
|
2014-05-16 18:51:01 +08:00
|
|
|
}
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
//++
|
|
|
|
//------------------------------------------------------------------------------------
|
2014-11-18 02:06:21 +08:00
|
|
|
// Details: CMICmdCmdSource destructor.
|
|
|
|
// Type: Overrideable.
|
|
|
|
// Args: None.
|
|
|
|
// Return: None.
|
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
CMICmdCmdSource::~CMICmdCmdSource() {}
|
|
|
|
|
|
|
|
//++
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// Details: The invoker requires this function. The command does work in this
|
|
|
|
// function.
|
|
|
|
// The command is likely to communicate with the LLDB SBDebugger in
|
|
|
|
// here.
|
2014-11-18 02:06:21 +08:00
|
|
|
// Type: Overridden.
|
|
|
|
// Args: None.
|
|
|
|
// Return: MIstatus::success - Functional succeeded.
|
|
|
|
// MIstatus::failure - Functional failed.
|
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
bool CMICmdCmdSource::Execute() {
|
|
|
|
// Do nothing
|
|
|
|
return MIstatus::success;
|
2014-05-16 18:51:01 +08:00
|
|
|
}
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
//++
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// Details: The invoker requires this function. The command prepares a MI Record
|
|
|
|
// Result
|
2014-11-18 02:06:21 +08:00
|
|
|
// for the work carried out in the Execute().
|
|
|
|
// Type: Overridden.
|
|
|
|
// Args: None.
|
|
|
|
// Return: MIstatus::success - Functional succeeded.
|
|
|
|
// MIstatus::failure - Functional failed.
|
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
bool CMICmdCmdSource::Acknowledge() {
|
|
|
|
const CMICmnMIResultRecord miRecordResult(
|
|
|
|
m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done);
|
|
|
|
m_miResultRecord = miRecordResult;
|
2014-11-18 02:06:21 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
return MIstatus::success;
|
2014-05-16 18:51:01 +08:00
|
|
|
}
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
//++
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
// Details: Required by the CMICmdFactory when registering *this command. The
|
|
|
|
// factory
|
2014-11-18 02:06:21 +08:00
|
|
|
// calls this function to create an instance of *this command.
|
|
|
|
// Type: Static method.
|
|
|
|
// Args: None.
|
|
|
|
// Return: CMICmdBase * - Pointer to a new command.
|
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
CMICmdBase *CMICmdCmdSource::CreateSelf() { return new CMICmdCmdSource(); }
|