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
|
|
|
// File: MICmdCommands.cpp
|
2014-05-16 18:51:01 +08:00
|
|
|
//
|
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
|
|
|
//
|
2014-11-18 02:06:21 +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
|
|
|
|
// 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
|
|
|
//
|
2014-11-18 02:06:21 +08:00
|
|
|
// Environment: Compilers: Visual C++ 12.
|
|
|
|
// gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
|
|
|
|
// Libraries: See MIReadmetxt.
|
2014-05-16 18:51:01 +08:00
|
|
|
//
|
2014-11-18 02:06:21 +08:00
|
|
|
// Copyright: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
|
|
|
|
|
|
|
// In-house headers:
|
|
|
|
#include "MICmdCommands.h"
|
|
|
|
#include "MICmdFactory.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"
|
|
|
|
#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"
|
|
|
|
|
|
|
|
namespace MICmnCommands
|
|
|
|
{
|
2014-11-18 02:06:21 +08:00
|
|
|
template <typename T> static bool Register(void);
|
2014-05-16 18:51:01 +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.
|
|
|
|
// Return: bool - True = yes command is registered, false = command failed to register.
|
|
|
|
// Throws: None.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2014-11-18 02:06:21 +08:00
|
|
|
template <typename T>
|
|
|
|
static bool
|
|
|
|
MICmnCommands::Register(void)
|
|
|
|
{
|
|
|
|
static CMICmdFactory &rCmdFactory = CMICmdFactory::Instance();
|
|
|
|
const CMIUtilString strMiCmd = T().GetMiCmd();
|
|
|
|
CMICmdFactory::CmdCreatorFnPtr fn = T().GetCmdCreatorFn();
|
|
|
|
return rCmdFactory.CmdRegister(strMiCmd, fn);
|
|
|
|
}
|
2014-05-16 18:51:01 +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
|
|
|
//--
|
2014-11-18 02:06:21 +08:00
|
|
|
bool
|
|
|
|
MICmnCommands::RegisterAll(void)
|
2014-05-16 18:51:01 +08:00
|
|
|
{
|
2014-11-18 02:06:21 +08:00
|
|
|
bool bOk = MIstatus::success;
|
2014-05-16 18:51:01 +08:00
|
|
|
|
2014-11-18 02:06:21 +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<CMICmdCmdDataReadMemoryBytes>();
|
|
|
|
bOk &= Register<CMICmdCmdDataReadMemory>();
|
|
|
|
bOk &= Register<CMICmdCmdDataListRegisterNames>();
|
|
|
|
bOk &= Register<CMICmdCmdDataListRegisterValues>();
|
|
|
|
bOk &= Register<CMICmdCmdDataWriteMemory>();
|
|
|
|
bOk &= Register<CMICmdCmdEnablePrettyPrinting>();
|
|
|
|
bOk &= Register<CMICmdCmdEnvironmentCd>();
|
2015-02-13 22:31:06 +08:00
|
|
|
bOk &= Register<CMICmdCmdExecArguments>();
|
2014-11-18 02:06:21 +08:00
|
|
|
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<CMICmdCmdGdbThread>();
|
|
|
|
bOk &= Register<CMICmdCmdInferiorTtySet>();
|
|
|
|
bOk &= Register<CMICmdCmdInterpreterExec>();
|
|
|
|
bOk &= Register<CMICmdCmdListThreadGroups>();
|
|
|
|
bOk &= Register<CMICmdCmdSource>();
|
|
|
|
bOk &= Register<CMICmdCmdStackInfoDepth>();
|
2015-02-19 23:14:17 +08:00
|
|
|
bOk &= Register<CMICmdCmdStackInfoFrame>();
|
2014-11-18 02:06:21 +08:00
|
|
|
bOk &= Register<CMICmdCmdStackListFrames>();
|
|
|
|
bOk &= Register<CMICmdCmdStackListArguments>();
|
|
|
|
bOk &= Register<CMICmdCmdStackListLocals>();
|
2015-02-20 03:26:52 +08:00
|
|
|
bOk &= Register<CMICmdCmdStackSelectFrame>();
|
2014-11-18 02:06:21 +08:00
|
|
|
bOk &= Register<CMICmdCmdSupportListFeatures>();
|
2015-02-20 21:07:41 +08:00
|
|
|
bOk &= Register<CMICmdCmdSymbolListLines>();
|
2014-11-18 02:06:21 +08:00
|
|
|
bOk &= Register<CMICmdCmdTargetSelect>();
|
|
|
|
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
|
|
|
|
2014-11-18 02:06:21 +08:00
|
|
|
return bOk;
|
2014-06-25 00:35:50 +08:00
|
|
|
}
|