2014-05-16 18:51:01 +08:00
|
|
|
//===-- MICmdCommands.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: MI command are registered with the MI command factory.
|
2014-05-16 18:51:01 +08:00
|
|
|
//
|
2016-09-07 04:57:50 +08:00
|
|
|
// To implement new MI commands derive a new command class from the
|
|
|
|
// command base
|
|
|
|
// class. To enable the new command for interpretation add the new
|
|
|
|
// command class
|
2014-11-18 02:06:21 +08:00
|
|
|
// to the command factory. The files of relevance are:
|
|
|
|
// MICmdCommands.cpp
|
|
|
|
// MICmdBase.h / .cpp
|
|
|
|
// MICmdCmd.h / .cpp
|
2014-05-16 18:51:01 +08:00
|
|
|
|
|
|
|
// In-house headers:
|
|
|
|
#include "MICmdCommands.h"
|
|
|
|
#include "MICmdCmd.h"
|
|
|
|
#include "MICmdCmdBreak.h"
|
|
|
|
#include "MICmdCmdData.h"
|
|
|
|
#include "MICmdCmdEnviro.h"
|
|
|
|
#include "MICmdCmdExec.h"
|
|
|
|
#include "MICmdCmdFile.h"
|
2014-06-25 00:35:50 +08:00
|
|
|
#include "MICmdCmdGdbInfo.h"
|
|
|
|
#include "MICmdCmdGdbSet.h"
|
2015-03-25 05:15:42 +08:00
|
|
|
#include "MICmdCmdGdbShow.h"
|
2014-06-25 00:35:50 +08:00
|
|
|
#include "MICmdCmdGdbThread.h"
|
2014-05-16 18:51:01 +08:00
|
|
|
#include "MICmdCmdMiscellanous.h"
|
|
|
|
#include "MICmdCmdStack.h"
|
|
|
|
#include "MICmdCmdSupportInfo.h"
|
|
|
|
#include "MICmdCmdSupportList.h"
|
2015-02-20 21:07:41 +08:00
|
|
|
#include "MICmdCmdSymbol.h"
|
2014-05-16 18:51:01 +08:00
|
|
|
#include "MICmdCmdTarget.h"
|
|
|
|
#include "MICmdCmdThread.h"
|
|
|
|
#include "MICmdCmdTrace.h"
|
|
|
|
#include "MICmdCmdVar.h"
|
2016-09-07 04:57:50 +08:00
|
|
|
#include "MICmdFactory.h"
|
2014-05-16 18:51:01 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
namespace MICmnCommands {
|
2015-08-04 18:24:20 +08:00
|
|
|
template <typename T> static bool Register();
|
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: Command to command factory registration function.
|
|
|
|
// Type: Template function.
|
|
|
|
// Args: typename T - A command type class.
|
2016-09-07 04:57:50 +08:00
|
|
|
// Return: bool - True = yes command is registered, false = command failed to
|
|
|
|
// register.
|
2014-11-18 02:06:21 +08:00
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
template <typename T> static bool MICmnCommands::Register() {
|
|
|
|
static CMICmdFactory &rCmdFactory = CMICmdFactory::Instance();
|
|
|
|
const CMIUtilString strMiCmd = T().GetMiCmd();
|
|
|
|
CMICmdFactory::CmdCreatorFnPtr fn = T().GetCmdCreatorFn();
|
|
|
|
return rCmdFactory.CmdRegister(strMiCmd, fn);
|
2014-11-18 02:06:21 +08:00
|
|
|
}
|
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: Register commands with MI command factory
|
|
|
|
// Type: Function.
|
|
|
|
// Args: None.
|
|
|
|
// Return: bool - True = yes all commands are registered,
|
|
|
|
// false = one or more commands failed to register.
|
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
bool MICmnCommands::RegisterAll() {
|
|
|
|
bool bOk = MIstatus::success;
|
2014-05-16 18:51:01 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
bOk &= Register<CMICmdCmdSupportInfoMiCmdQuery>();
|
|
|
|
bOk &= Register<CMICmdCmdBreakAfter>();
|
|
|
|
bOk &= Register<CMICmdCmdBreakCondition>();
|
|
|
|
bOk &= Register<CMICmdCmdBreakDelete>();
|
|
|
|
bOk &= Register<CMICmdCmdBreakDisable>();
|
|
|
|
bOk &= Register<CMICmdCmdBreakEnable>();
|
|
|
|
bOk &= Register<CMICmdCmdBreakInsert>();
|
|
|
|
bOk &= Register<CMICmdCmdDataDisassemble>();
|
|
|
|
bOk &= Register<CMICmdCmdDataEvaluateExpression>();
|
|
|
|
bOk &= Register<CMICmdCmdDataInfoLine>();
|
|
|
|
bOk &= Register<CMICmdCmdDataReadMemoryBytes>();
|
|
|
|
bOk &= Register<CMICmdCmdDataReadMemory>();
|
|
|
|
bOk &= Register<CMICmdCmdDataListRegisterNames>();
|
|
|
|
bOk &= Register<CMICmdCmdDataListRegisterValues>();
|
|
|
|
bOk &= Register<CMICmdCmdDataWriteMemory>();
|
|
|
|
bOk &= Register<CMICmdCmdEnablePrettyPrinting>();
|
|
|
|
bOk &= Register<CMICmdCmdEnvironmentCd>();
|
|
|
|
bOk &= Register<CMICmdCmdExecAbort>();
|
|
|
|
bOk &= Register<CMICmdCmdExecArguments>();
|
|
|
|
bOk &= Register<CMICmdCmdExecContinue>();
|
|
|
|
bOk &= Register<CMICmdCmdExecInterrupt>();
|
|
|
|
bOk &= Register<CMICmdCmdExecFinish>();
|
|
|
|
bOk &= Register<CMICmdCmdExecNext>();
|
|
|
|
bOk &= Register<CMICmdCmdExecNextInstruction>();
|
|
|
|
bOk &= Register<CMICmdCmdExecRun>();
|
|
|
|
bOk &= Register<CMICmdCmdExecStep>();
|
|
|
|
bOk &= Register<CMICmdCmdExecStepInstruction>();
|
|
|
|
bOk &= Register<CMICmdCmdFileExecAndSymbols>();
|
|
|
|
bOk &= Register<CMICmdCmdGdbExit>();
|
|
|
|
bOk &= Register<CMICmdCmdGdbInfo>();
|
|
|
|
bOk &= Register<CMICmdCmdGdbSet>();
|
|
|
|
bOk &= Register<CMICmdCmdGdbShow>();
|
|
|
|
bOk &= Register<CMICmdCmdGdbThread>();
|
|
|
|
bOk &= Register<CMICmdCmdInferiorTtySet>();
|
|
|
|
bOk &= Register<CMICmdCmdInterpreterExec>();
|
|
|
|
bOk &= Register<CMICmdCmdListThreadGroups>();
|
|
|
|
bOk &= Register<CMICmdCmdSource>();
|
|
|
|
bOk &= Register<CMICmdCmdStackInfoDepth>();
|
|
|
|
bOk &= Register<CMICmdCmdStackInfoFrame>();
|
|
|
|
bOk &= Register<CMICmdCmdStackListFrames>();
|
|
|
|
bOk &= Register<CMICmdCmdStackListArguments>();
|
|
|
|
bOk &= Register<CMICmdCmdStackListLocals>();
|
|
|
|
bOk &= Register<CMICmdCmdStackListVariables>();
|
|
|
|
bOk &= Register<CMICmdCmdStackSelectFrame>();
|
|
|
|
bOk &= Register<CMICmdCmdSupportListFeatures>();
|
|
|
|
bOk &= Register<CMICmdCmdSymbolListLines>();
|
|
|
|
bOk &= Register<CMICmdCmdTargetSelect>();
|
|
|
|
bOk &= Register<CMICmdCmdTargetAttach>();
|
|
|
|
bOk &= Register<CMICmdCmdTargetDetach>();
|
|
|
|
bOk &= Register<CMICmdCmdThreadInfo>();
|
|
|
|
bOk &= Register<CMICmdCmdVarAssign>();
|
|
|
|
bOk &= Register<CMICmdCmdVarCreate>();
|
|
|
|
bOk &= Register<CMICmdCmdVarDelete>();
|
|
|
|
bOk &= Register<CMICmdCmdVarEvaluateExpression>();
|
|
|
|
bOk &= Register<CMICmdCmdVarInfoPathExpression>();
|
|
|
|
bOk &= Register<CMICmdCmdVarListChildren>();
|
|
|
|
bOk &= Register<CMICmdCmdVarSetFormat>();
|
|
|
|
bOk &= Register<CMICmdCmdVarShowAttributes>();
|
|
|
|
bOk &= Register<CMICmdCmdVarUpdate>();
|
2014-05-16 18:51:01 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
return bOk;
|
2014-06-25 00:35:50 +08:00
|
|
|
}
|