summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi/MICmdArgSet.h
diff options
context:
space:
mode:
authorDeepak Panickal <deepak@codeplay.com>2014-05-16 10:51:01 +0000
committerDeepak Panickal <deepak@codeplay.com>2014-05-16 10:51:01 +0000
commit6f9c46810298dd00dc95d4ffb60faf7d914ab978 (patch)
tree7d8abbb2b6cd0aa3dfb8824f318baa432bb9e3c4 /lldb/tools/lldb-mi/MICmdArgSet.h
parentd04688d1c6cdffae4623a3a60e2d46f0bd72fe48 (diff)
downloadbcm5719-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/MICmdArgSet.h')
-rw-r--r--lldb/tools/lldb-mi/MICmdArgSet.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/lldb/tools/lldb-mi/MICmdArgSet.h b/lldb/tools/lldb-mi/MICmdArgSet.h
new file mode 100644
index 00000000000..5deaeb51ad1
--- /dev/null
+++ b/lldb/tools/lldb-mi/MICmdArgSet.h
@@ -0,0 +1,108 @@
+//===-- MICmdArgSet.h -------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+//++
+// File: MICmdArgSet.h
+//
+// Overview: CMICmdArgSet interface.
+//
+// Environment: Compilers: Visual C++ 12.
+// gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
+// Libraries: See MIReadmetxt.
+//
+// Copyright: None.
+//--
+
+#pragma once
+
+// Third party headers:
+#include <vector>
+
+// In-house headers:
+#include "MICmnBase.h"
+#include "MICmdArgContext.h"
+
+// Declarations:
+class CMICmdArgValBase;
+
+//++ ============================================================================
+// Details: MI common code class. Command arguments container class.
+// A command may have one or more arguments of which some may be optional.
+// *this class contains a list of the command's arguments which are
+// validates against the commands argument options string (context string).
+// Each argument tries to extract the value it is looking for.
+// Argument objects added to *this container are owned by this container
+// and are deleted when this container goes out of scope. Allocate argument
+// objects on the heap.
+// It is assummed the arguments to be parsed are read from left to right in
+// order. The order added to *this container is the order they will parsed.
+// Gotchas: None.
+// Authors: Illya Rudkin 14/04/2014.
+// Changes: None.
+//--
+class CMICmdArgSet : public CMICmnBase
+{
+// Classes:
+public:
+ //++
+ // Description: ArgSet's interface for command arguments to implement.
+ //--
+ class IArg
+ {
+ public:
+ virtual bool GetFound( void ) const = 0;
+ virtual bool GetIsHandledByCmd( void ) const = 0;
+ virtual bool GetIsMandatory( void ) const = 0;
+ virtual bool GetIsMissingOptions( void ) const = 0;
+ virtual const CMIUtilString & GetName( void ) const = 0;
+ virtual bool GetValid( void ) const = 0;
+ virtual bool Validate( CMICmdArgContext & vwArgContext ) = 0;
+
+ /* dtor */ virtual ~IArg( void ) {};
+ };
+
+// Typedefs:
+public:
+ typedef std::vector< CMICmdArgValBase * > SetCmdArgs_t;
+
+// Methods:
+public:
+ /* ctor */ CMICmdArgSet( void );
+
+ bool Add( const CMICmdArgValBase & vArg );
+ bool GetArg( const CMIUtilString & vArgName, CMICmdArgValBase *& vpArg ) const;
+ const SetCmdArgs_t & GetArgsThatAreMissing( void ) const;
+ const SetCmdArgs_t & GetArgsThatInvalid( void ) const;
+ MIuint GetCount( void ) const;
+ bool IsArgContextEmpty( void ) const;
+ bool IsArgsPresentButNotHandledByCmd( void ) const;
+ void WarningArgsNotHandledbyCmdLogFile( const CMIUtilString & vrCmdName );
+ bool Validate( const CMIUtilString & vStrMiCmd, CMICmdArgContext & vwCmdArgsText );
+
+// Overrideable:
+public:
+ /* dtor */ virtual ~CMICmdArgSet( void );
+
+// Methods:
+private:
+ const SetCmdArgs_t & GetArgsNotHandledByCmd( void ) const;
+ void Destroy( void ); // Release resources used by *this object
+
+// Attributes:
+private:
+ bool m_bIsArgsPresentButNotHandledByCmd; // True = The driver's client presented the command with options recognised but not handled by a command, false = all args handled
+ SetCmdArgs_t m_setCmdArgs; // The set of arguments that are that the command is expecting to find in the options string
+ SetCmdArgs_t m_setCmdArgsThatAreMissing; // The set of arguments that are required by the command but are missing
+ SetCmdArgs_t m_setCmdArgsThatNotValid; // The set of arguments found in the text but for some reason unable to extract a value
+ SetCmdArgs_t m_setCmdArgsNotHandledByCmd; // The set of arguments specified by the command which were present to the command but not handled
+ SetCmdArgs_t m_setCmdArgsMissingInfo; // The set of arguments that were present but were found to be missing additional information i.e. --thread 3 but 3 is missing
+ CMICmdArgContext m_cmdArgContext; // Copy of the command's argument options text before validate takes place (empties it of content)
+ const CMIUtilString m_constStrCommaSpc;
+};
+
OpenPOWER on IntegriCloud