9#ifndef LLDB_INTERPRETER_INTERFACES_SCRIPTEDINTERFACE_H
10#define LLDB_INTERPRETER_INTERFACES_SCRIPTEDINTERFACE_H
20#include "llvm/Support/Compiler.h"
36 template <
typename Ret>
42 std::string full_error_message =
43 llvm::Twine(caller_name + llvm::Twine(
" ERROR = ") +
44 llvm::Twine(error_msg))
46 if (
const char *detailed_error =
error.AsCString())
48 llvm::Twine(llvm::Twine(
" (") + llvm::Twine(detailed_error) +
51 error.SetErrorString(full_error_message);
55 template <
typename T = StructuredData::ObjectSP>
59 return ErrorWithMessage<bool>(caller,
"Null Structured Data object",
62 if (!obj->IsValid()) {
63 return ErrorWithMessage<bool>(caller,
"Invalid StructuredData object",
68 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_caterogy=LLDBLog::Process)
virtual ~ScriptedInterface()=default
static bool CheckStructuredDataObject(llvm::StringRef caller, T obj, Status &error)
ScriptedInterface()=default
StructuredData::GenericSP GetScriptObjectInstance()
static bool CreateInstance(lldb::ScriptLanguage language, ScriptedInterfaceUsages usages)
virtual llvm::SmallVector< llvm::StringLiteral > GetAbstractMethods() const =0
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.