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
|
|
|
//
|
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
|
|
|
|
|
|
|
// 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"
|
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"
|
|
|
|
|
|
|
|
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>();
|
2015-04-30 15:14:24 +08:00
|
|
|
bOk &= Register<CMICmdCmdDataInfoLine>();
|
2014-11-18 02:06:21 +08:00
|
|
|
bOk &= Register<CMICmdCmdDataReadMemoryBytes>();
|
|
|
|
bOk &= Register<CMICmdCmdDataReadMemory>();
|
|
|
|
bOk &= Register<CMICmdCmdDataListRegisterNames>();
|
|
|
|
bOk &= Register<CMICmdCmdDataListRegisterValues>();
|
|
|
|
bOk &= Register<CMICmdCmdDataWriteMemory>();
|
|
|
|
bOk &= Register<CMICmdCmdEnablePrettyPrinting>();
|
|
|
|
bOk &= Register<CMICmdCmdEnvironmentCd>();
|
Add -exec-abort command (MI); Don't exit on eStateExited
Summary:
Add -exec-abort command + test.
Also, I had fixed an error, when lldb-mi exits on eStateExited. With current patch we can re-run target:
```
-file-exec-and-symbols hello
^done
-exec-run
^running
*stopped,reason="breakpoint-hit"...
-exec-abort
^done
*stopped,reason="exited-normally"... <- program exits
-exec-run <- run again
^running
*stopped,reason="breakpoint-hit"...
```
All tests pass on OS X.
Reviewers: zturner, emaste, abidh, clayborg
Reviewed By: abidh, clayborg
Subscribers: lldb-commits, emaste, zturner, clayborg, abidh
Differential Revision: http://reviews.llvm.org/D7794
llvm-svn: 230321
2015-02-24 18:40:45 +08:00
|
|
|
bOk &= Register<CMICmdCmdExecAbort>();
|
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>();
|
2015-03-25 05:15:42 +08:00
|
|
|
bOk &= Register<CMICmdCmdGdbShow>();
|
2014-11-18 02:06:21 +08:00
|
|
|
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-04-29 16:18:41 +08:00
|
|
|
bOk &= Register<CMICmdCmdStackListVariables>();
|
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>();
|
2015-05-07 15:38:49 +08:00
|
|
|
bOk &= Register<CMICmdCmdTargetAttach>();
|
|
|
|
bOk &= Register<CMICmdCmdTargetDetach>();
|
2014-11-18 02:06:21 +08:00
|
|
|
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
|
|
|
}
|