mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-24 18:20:38 +00:00
b9c1b51e45
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
69 lines
2.3 KiB
C++
69 lines
2.3 KiB
C++
//===-- StructuredDataPlugin.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/Target/StructuredDataPlugin.h"
|
|
|
|
#include "lldb/Core/Debugger.h"
|
|
#include "lldb/Interpreter/CommandInterpreter.h"
|
|
#include "lldb/Interpreter/CommandObjectMultiword.h"
|
|
|
|
using namespace lldb;
|
|
using namespace lldb_private;
|
|
|
|
namespace {
|
|
class CommandStructuredData : public CommandObjectMultiword {
|
|
public:
|
|
CommandStructuredData(CommandInterpreter &interpreter)
|
|
: CommandObjectMultiword(interpreter, "structured-data",
|
|
"Parent for per-plugin structured data commands",
|
|
"plugin structured-data <plugin>") {}
|
|
|
|
~CommandStructuredData() {}
|
|
};
|
|
}
|
|
|
|
StructuredDataPlugin::StructuredDataPlugin(const ProcessWP &process_wp)
|
|
: PluginInterface(), m_process_wp(process_wp) {}
|
|
|
|
StructuredDataPlugin::~StructuredDataPlugin() {}
|
|
|
|
bool StructuredDataPlugin::GetEnabled(const ConstString &type_name) const {
|
|
// By default, plugins are always enabled. Plugin authors should override
|
|
// this if there is an enabled/disabled state for their plugin.
|
|
return true;
|
|
}
|
|
|
|
ProcessSP StructuredDataPlugin::GetProcess() const {
|
|
return m_process_wp.lock();
|
|
}
|
|
|
|
void StructuredDataPlugin::InitializeBasePluginForDebugger(Debugger &debugger) {
|
|
// Create our mutliword command anchor if it doesn't already exist.
|
|
auto &interpreter = debugger.GetCommandInterpreter();
|
|
if (!interpreter.GetCommandObject("plugin structured-data")) {
|
|
// Find the parent command.
|
|
auto parent_command =
|
|
debugger.GetCommandInterpreter().GetCommandObject("plugin");
|
|
if (!parent_command)
|
|
return;
|
|
|
|
// Create the structured-data ommand object.
|
|
auto command_name = "structured-data";
|
|
auto command_sp = CommandObjectSP(new CommandStructuredData(interpreter));
|
|
|
|
// Hook it up under the top-level plugin command.
|
|
parent_command->LoadSubCommand(command_name, command_sp);
|
|
}
|
|
}
|
|
|
|
void StructuredDataPlugin::ModulesDidLoad(Process &process,
|
|
ModuleList &module_list) {
|
|
// Default implementation does nothing.
|
|
}
|