From 614dc150ec761140d21f52c9bb1a1c45db38e12f Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 27 Oct 2016 23:18:52 +0000 Subject: Revert "[Test Suite] Pull generateSource into lldbtest" This reverts commit r285357. I committed this patch accidentally out of order. Will recommit when the change this depends on is landed. llvm-svn: 285361 --- .../plugins/commands/TestPluginCommands.py | 4 -- .../functionalities/plugins/commands/plugin.cpp | 62 ++++++++++++++++++++++ .../plugins/commands/plugin.cpp.template | 54 ------------------- 3 files changed, 62 insertions(+), 58 deletions(-) create mode 100644 lldb/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp delete mode 100644 lldb/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template (limited to 'lldb/packages/Python/lldbsuite/test/functionalities') diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py b/lldb/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py index 18fcc41fa9f..9341ff97e6f 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py @@ -18,10 +18,6 @@ class PluginCommandTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - def setUp(self): - TestBase.setUp(self) - self.generateSource('plugin.cpp') - @skipIfNoSBHeaders # Requires a compatible arch and platform to link against the host's built # lldb lib. diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp new file mode 100644 index 00000000000..be3d29325de --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp @@ -0,0 +1,62 @@ +//===-- plugin.cpp -------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +/* +An example plugin for LLDB that provides a new foo command with a child subcommand +Compile this into a dylib foo.dylib and load by placing in appropriate locations on disk or +by typing plugin load foo.dylib at the LLDB command line +*/ + +#if defined (__APPLE__) +#include +#include +#include +#else +#include +#include +#include +#endif + +namespace lldb { + bool + PluginInitialize (lldb::SBDebugger debugger); +} + +class ChildCommand : public lldb::SBCommandPluginInterface +{ +public: + virtual bool + DoExecute (lldb::SBDebugger debugger, + char** command, + lldb::SBCommandReturnObject &result) + { + if (command) + { + const char* arg = *command; + while (arg) + { + result.Printf("%s ",arg); + arg = *(++command); + } + result.Printf("\n"); + return true; + } + return false; + } + +}; + +bool +lldb::PluginInitialize (lldb::SBDebugger debugger) +{ + lldb::SBCommandInterpreter interpreter = debugger.GetCommandInterpreter(); + lldb::SBCommand foo = interpreter.AddMultiwordCommand("plugin_loaded_command",NULL); + foo.AddCommand("child",new ChildCommand(),"a child of plugin_loaded_command"); + return true; +} diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template b/lldb/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template deleted file mode 100644 index 393e9feec79..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template +++ /dev/null @@ -1,54 +0,0 @@ -//===-- plugin.cpp -------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -/* -An example plugin for LLDB that provides a new foo command with a child subcommand -Compile this into a dylib foo.dylib and load by placing in appropriate locations on disk or -by typing plugin load foo.dylib at the LLDB command line -*/ - -%include_SB_APIs% - -namespace lldb { - bool - PluginInitialize (lldb::SBDebugger debugger); -} - -class ChildCommand : public lldb::SBCommandPluginInterface -{ -public: - virtual bool - DoExecute (lldb::SBDebugger debugger, - char** command, - lldb::SBCommandReturnObject &result) - { - if (command) - { - const char* arg = *command; - while (arg) - { - result.Printf("%s ",arg); - arg = *(++command); - } - result.Printf("\n"); - return true; - } - return false; - } - -}; - -bool -lldb::PluginInitialize (lldb::SBDebugger debugger) -{ - lldb::SBCommandInterpreter interpreter = debugger.GetCommandInterpreter(); - lldb::SBCommand foo = interpreter.AddMultiwordCommand("plugin_loaded_command",NULL); - foo.AddCommand("child",new ChildCommand(),"a child of plugin_loaded_command"); - return true; -} -- cgit v1.2.3