diff options
| author | Deepak Panickal <deepak@codeplay.com> | 2014-05-16 10:51:01 +0000 |
|---|---|---|
| committer | Deepak Panickal <deepak@codeplay.com> | 2014-05-16 10:51:01 +0000 |
| commit | 6f9c46810298dd00dc95d4ffb60faf7d914ab978 (patch) | |
| tree | 7d8abbb2b6cd0aa3dfb8824f318baa432bb9e3c4 /lldb/tools/lldb-mi/MICmdCommands.cpp | |
| parent | d04688d1c6cdffae4623a3a60e2d46f0bd72fe48 (diff) | |
| download | bcm5719-llvm-6f9c46810298dd00dc95d4ffb60faf7d914ab978.tar.gz bcm5719-llvm-6f9c46810298dd00dc95d4ffb60faf7d914ab978.zip | |
Initial commit of LLDB Machine Interface Frontend.
- Tested with Eclipse, likely to work with other GDB/MI compatible GUIs.
- Some but not all MI commands have been implemented. See MIReadme.txt for more info.
- Written from scratch, no GPL code, based on LLDB Public API.
- Built for Linux, Windows and OSX. Tested on Linux and Windows.
- GDB/MI Command Reference, https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html
llvm-svn: 208972
Diffstat (limited to 'lldb/tools/lldb-mi/MICmdCommands.cpp')
| -rw-r--r-- | lldb/tools/lldb-mi/MICmdCommands.cpp | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/lldb/tools/lldb-mi/MICmdCommands.cpp b/lldb/tools/lldb-mi/MICmdCommands.cpp new file mode 100644 index 00000000000..fa681946d6b --- /dev/null +++ b/lldb/tools/lldb-mi/MICmdCommands.cpp @@ -0,0 +1,118 @@ +//===-- MICmdCommands.cpp ---------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +//++ +// File: MICmdCommands.cpp +// +// Overview: MI command are registered with the MI command factory. +// +// 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 +// +// Environment: Compilers: Visual C++ 12. +// gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 +// Libraries: See MIReadmetxt. +// +// Copyright: None. +//-- + +// 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" +#include "MICmdCmdMiscellanous.h" +#include "MICmdCmdStack.h" +#include "MICmdCmdSupportInfo.h" +#include "MICmdCmdSupportList.h" +#include "MICmdCmdTarget.h" +#include "MICmdCmdThread.h" +#include "MICmdCmdTrace.h" +#include "MICmdCmdVar.h" + +namespace MICmnCommands +{ + template< typename T > + static bool Register( void ); +} + +//++ ------------------------------------------------------------------------------------ +// Details: Command to command factory registration function. +// Type: Template function. +// Args: None. +// Return: bool - True = yes command is registered, false = command failed to register. +// Throws: None. +//-- +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 ); +} + +//++ ------------------------------------------------------------------------------------ +// 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. +//-- +bool MICmnCommands::RegisterAll( void ) +{ + bool bOk = MIstatus::success; + + bOk &= Register< CMICmdCmdSupportInfoMiCmdQuery >(); + bOk &= Register< CMICmdCmdSupportListFeatures >(); + bOk &= Register< CMICmdCmdEnvironmentCd >(); + bOk &= Register< CMICmdCmdGdbSet >(); + bOk &= Register< CMICmdCmdEnablePrettyPrinting >(); + bOk &= Register< CMICmdCmdGdbExit >(); + bOk &= Register< CMICmdCmdSource >(); + bOk &= Register< CMICmdCmdFileExecAndSymbols >(); + bOk &= Register< CMICmdCmdTargetSelect >(); + bOk &= Register< CMICmdCmdListThreadGroups >(); + bOk &= Register< CMICmdCmdExecRun >(); + bOk &= Register< CMICmdCmdExecContinue >(); + bOk &= Register< CMICmdCmdTraceStatus >(); + bOk &= Register< CMICmdCmdThreadInfo >(); + bOk &= Register< CMICmdCmdBreakInsert >(); + bOk &= Register< CMICmdCmdBreakDelete >(); + bOk &= Register< CMICmdCmdThread >(); + bOk &= Register< CMICmdCmdStackInfoDepth >(); + bOk &= Register< CMICmdCmdStackListFrames >(); + bOk &= Register< CMICmdCmdStackListArguments >(); + bOk &= Register< CMICmdCmdStackListLocals >(); + bOk &= Register< CMICmdCmdVarCreate >(); + bOk &= Register< CMICmdCmdExecNext >(); + bOk &= Register< CMICmdCmdExecStep >(); + bOk &= Register< CMICmdCmdExecNextInstruction >(); + bOk &= Register< CMICmdCmdExecStepInstruction >(); + bOk &= Register< CMICmdCmdExecFinish >(); + bOk &= Register< CMICmdCmdVarUpdate >(); + bOk &= Register< CMICmdCmdVarDelete >(); + bOk &= Register< CMICmdCmdVarAssign >(); + bOk &= Register< CMICmdCmdVarSetFormat >(); + bOk &= Register< CMICmdCmdVarListChildren >(); + bOk &= Register< CMICmdCmdVarEvaluateExpression >(); + bOk &= Register< CMICmdCmdVarInfoPathExpression >(); + bOk &= Register< CMICmdCmdDataEvaluateExpression >(); + + return bOk; +}
\ No newline at end of file |

