mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-23 05:25:50 -04:00

*** 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
48 lines
1.4 KiB
C++
48 lines
1.4 KiB
C++
//===-- fooplugin.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 <LLDB/SBCommandInterpreter.h>
|
|
#include <LLDB/SBCommandReturnObject.h>
|
|
#include <LLDB/SBDebugger.h>
|
|
|
|
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\n", arg);
|
|
arg = *(++command);
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
};
|
|
|
|
bool lldb::PluginInitialize(lldb::SBDebugger debugger) {
|
|
lldb::SBCommandInterpreter interpreter = debugger.GetCommandInterpreter();
|
|
lldb::SBCommand foo = interpreter.AddMultiwordCommand("foo", NULL);
|
|
foo.AddCommand("child", new ChildCommand(), "a child of foo");
|
|
return true;
|
|
}
|