diff options
| author | Colin Riley <colin@codeplay.com> | 2015-05-04 18:39:38 +0000 |
|---|---|---|
| committer | Colin Riley <colin@codeplay.com> | 2015-05-04 18:39:38 +0000 |
| commit | c9c55a26bd7fe1962ea1529ee0d0ccd0ea9f90da (patch) | |
| tree | ac09f34d9dfecf32c8ca0e7c3528df34200e79af /lldb/source/Commands | |
| parent | b61f06c9c252e11f633626555bb444f30eb2d8ec (diff) | |
| download | bcm5719-llvm-c9c55a26bd7fe1962ea1529ee0d0ccd0ea9f90da.tar.gz bcm5719-llvm-c9c55a26bd7fe1962ea1529ee0d0ccd0ea9f90da.zip | |
Add language command and LanguageRuntime plugin changes to allow vending of command objects.
Differential Revision: http://reviews.llvm.org/D9402
llvm-svn: 236443
Diffstat (limited to 'lldb/source/Commands')
| -rw-r--r-- | lldb/source/Commands/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | lldb/source/Commands/CommandObjectLanguage.cpp | 46 | ||||
| -rw-r--r-- | lldb/source/Commands/CommandObjectLanguage.h | 41 |
3 files changed, 88 insertions, 0 deletions
diff --git a/lldb/source/Commands/CMakeLists.txt b/lldb/source/Commands/CMakeLists.txt index cee8146bee2..c27a805272d 100644 --- a/lldb/source/Commands/CMakeLists.txt +++ b/lldb/source/Commands/CMakeLists.txt @@ -29,4 +29,5 @@ add_lldb_library(lldbCommands CommandObjectVersion.cpp CommandObjectWatchpoint.cpp CommandObjectWatchpointCommand.cpp + CommandObjectLanguage.cpp ) diff --git a/lldb/source/Commands/CommandObjectLanguage.cpp b/lldb/source/Commands/CommandObjectLanguage.cpp new file mode 100644 index 00000000000..ae1df6cd218 --- /dev/null +++ b/lldb/source/Commands/CommandObjectLanguage.cpp @@ -0,0 +1,46 @@ +//===-- CommandObjectLanguage.cpp -------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/lldb-python.h"
+
+#include "CommandObjectLanguage.h"
+
+#include "lldb/Host/Host.h"
+
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/CommandReturnObject.h"
+
+#include "lldb/Target/LanguageRuntime.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+CommandObjectLanguage::CommandObjectLanguage (CommandInterpreter &interpreter) :
+CommandObjectMultiword (interpreter,
+ "language",
+ "A set of commands for managing language-specific functionality.'.",
+ "language <language-name> <subcommand> [<subcommand-options>]"
+ )
+{
+ //Let the LanguageRuntime populates this command with subcommands
+ LanguageRuntime::InitializeCommands(this);
+}
+
+void
+CommandObjectLanguage::GenerateHelpText (Stream &output_stream) {
+ CommandObjectMultiword::GenerateHelpText(output_stream);
+
+ output_stream << "\nlanguage name can be one of the following:\n";
+
+ LanguageRuntime::PrintAllLanguages(output_stream, " ", "\n");
+}
+
+CommandObjectLanguage::~CommandObjectLanguage ()
+{
+}
diff --git a/lldb/source/Commands/CommandObjectLanguage.h b/lldb/source/Commands/CommandObjectLanguage.h new file mode 100644 index 00000000000..751fe1440a8 --- /dev/null +++ b/lldb/source/Commands/CommandObjectLanguage.h @@ -0,0 +1,41 @@ +//===-- CommandObjectLanguage.h ---------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef liblldb_CommandObjectLanguage_h_ +#define liblldb_CommandObjectLanguage_h_ + +// C Includes +// C++ Includes + + +// Other libraries and framework includes +// Project includes + +#include "lldb/lldb-types.h" +#include "lldb/Interpreter/CommandObjectMultiword.h" + +namespace lldb_private { + class CommandObjectLanguage : public CommandObjectMultiword + { + public: + CommandObjectLanguage (CommandInterpreter &interpreter); + + virtual + ~CommandObjectLanguage (); + + virtual void + GenerateHelpText (Stream &output_stream); + + protected: + bool + DoExecute (Args& command, CommandReturnObject &result); + }; +} // namespace lldb_private + +#endif // liblldb_CommandObjectLanguage_h_ |

