9#ifndef LLDB_INTERPRETER_INTERFACES_SCRIPTEDINTERFACE_H
10#define LLDB_INTERPRETER_INTERFACES_SCRIPTEDINTERFACE_H
20#include "llvm/Support/Compiler.h"
39 virtual llvm::SmallVector<AbstractMethodRequirement>
43 llvm::SmallVector<llvm::StringLiteral> abstract_methods;
46 return requirement.name;
48 return abstract_methods;
51 template <
typename Ret>
57 std::string full_error_message =
58 llvm::Twine(caller_name + llvm::Twine(
" ERROR = ") +
59 llvm::Twine(error_msg))
61 if (
const char *detailed_error =
error.AsCString())
63 llvm::Twine(llvm::Twine(
" (") + llvm::Twine(detailed_error) +
70 template <
typename T = StructuredData::ObjectSP>
74 return ErrorWithMessage<bool>(caller,
"Null Structured Data object",
77 if (!obj->IsValid()) {
78 return ErrorWithMessage<bool>(caller,
"Invalid StructuredData object",
83 return ErrorWithMessage<bool>(caller,
error.AsCString(),
error);
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOGF(log,...)
static Ret ErrorWithMessage(llvm::StringRef caller_name, llvm::StringRef error_msg, Status &error, LLDBLog log_category=LLDBLog::Process)
virtual ~ScriptedInterface()=default
llvm::SmallVector< llvm::StringLiteral > const GetAbstractMethods() const
virtual llvm::SmallVector< AbstractMethodRequirement > GetAbstractMethodRequirements() const =0
static bool CheckStructuredDataObject(llvm::StringRef caller, T obj, Status &error)
ScriptedInterface()=default
StructuredData::GenericSP GetScriptObjectInstance()
static bool CreateInstance(lldb::ScriptLanguage language, ScriptedInterfaceUsages usages)
StructuredData::GenericSP m_object_instance_sp
std::shared_ptr< Generic > GenericSP
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
ScriptLanguage
Script interpreter types.