10#ifndef LLDB_TARGET_LANGUAGERUNTIME_H
11#define LLDB_TARGET_LANGUAGERUNTIME_H
33 bool update_module_list =
true);
112 return llvm::createStringError(
113 std::errc::invalid_argument,
114 "language doesn't support getting vtable information");
132 llvm::StringRef abstract_type_name) {
162 return llvm::Error::success();
180 virtual std::optional<Value>
182 llvm::ArrayRef<uint8_t> &following) {
224 virtual std::optional<lldb::ValueObjectSP>
237 std::optional<lldb::ValueObjectSP>
247 bool catch_bp,
bool throw_bp,
248 bool is_internal =
false);
267 bool catch_bp,
bool throw_bp) = 0;
270 return m_process->GetTarget().GetSearchFilterForModule(
nullptr);
273 virtual std::optional<uint64_t>
281 bool stop_others) = 0;
309 virtual bool isA(
const void *ClassID)
const {
return ClassID == &
ID; }
344 bool &behaves_like_zeroth_frame);
369 bool &behaves_like_zeroth_frame) {
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address class.
Generic representation of a type in a programming language.
static SearchFilter * CreateFromStructuredData(Target &target, const StructuredData::Dictionary &data_dict, Status &error)
void UpdateModuleListIfNeeded()
bool ModulePasses(const lldb::ModuleSP &module_sp) override
Call this method with a Module to see if that module passes the filter.
ExceptionSearchFilter(const lldb::TargetSP &target_sp, lldb::LanguageType language, bool update_module_list=true)
void Search(Searcher &searcher) override
Call this method to do the search using the Searcher.
lldb::SearchFilterSP m_filter_sp
~ExceptionSearchFilter() override=default
lldb::LanguageType m_language
std::unique_ptr< SearchFilter > DoCreateCopy() override
StructuredData::ObjectSP SerializeToStructuredData() override
void GetDescription(Stream *s) override
Prints a canonical description for the search filter to the stream s.
LanguageRuntime * m_language_runtime
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
std::optional< lldb::ValueObjectSP > GetThrownError(lldb::StackFrameSP caller_frame_sp) const
See LanguageRuntime::GetThrownError.
std::optional< Value > m_location
ThrownErrorLocation(lldb::StackFrameSP callee_frame_sp=nullptr)
LanguageRuntime * m_runtime
virtual llvm::Error FixupVariableLocation(Variable &variable, Value &value)
This allows a language runtime to adjust the location of variable computed from its debug info,...
virtual StructuredData::ObjectSP GetLanguageSpecificData(SymbolContext sc)
Language runtime plugins can use this API to report language-specific runtime information about this ...
virtual bool IsSymbolARuntimeThunk(const Symbol &symbol)
virtual std::optional< CompilerType > GetRuntimeType(CompilerType base_type)
LanguageRuntime(Process *process)
virtual void SetExceptionBreakpoints()
virtual lldb::LanguageType GetLanguageType() const =0
static CFAComparison CompareCFAs(Process &process, const StackID &lhs, const StackID &rhs)
Compares the frames identified by lhs and rhs, if a language runtime of process can order them.
virtual TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name, ValueObject &static_value)=0
virtual lldb::ThreadSP GetBacktraceThreadFromException(lldb::ValueObjectSP thread_sp)
virtual bool GetDynamicTypeAndAddress(ValueObject &in_value, lldb::DynamicValueType use_dynamic, TypeAndOrName &class_type_or_name, Address &address, Value::ValueType &value_type, llvm::ArrayRef< uint8_t > &local_buffer)=0
This call should return true if it could set the name and/or the type Sets address to the address of ...
virtual lldb::UnwindPlanSP GetRuntimeUnwindPlan(lldb::ProcessSP process_sp, lldb_private::RegisterContext *regctx, bool &behaves_like_zeroth_frame)
virtual lldb::ValueObjectSP GetExceptionObjectForThread(lldb::ThreadSP thread_sp)
static LanguageRuntime * FindPlugin(Process *process, lldb::LanguageType language)
virtual lldb::ValueObjectSP GetErrorValueAtBackstop(StackFrame &frame)
Return the error value that reached the breakpoint from CreateErrorBackstopBreakpoint,...
virtual CFAComparison CompareCFAs(const StackID &lhs, const StackID &rhs)
virtual bool ExceptionBreakpointsExplainStop(lldb::StopInfoSP stop_reason)
virtual bool IsAllowedRuntimeValue(llvm::StringRef name)
Identify whether a name is a runtime value that should not be hidden by from the user interface.
virtual void ClearExceptionBreakpoints()
virtual LanguageRuntime * GetPreferredLanguageRuntime(ValueObject &in_value)
Return the preferred language runtime instance, which in most cases will be the current instance.
virtual lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop_others)=0
virtual bool isA(const void *ClassID) const
virtual std::optional< Value > GetThrownErrorLocation(StackFrame &frame)
Given a frame, compute the location where its function would place an error, if one is thrown by the ...
virtual bool ExceptionBreakpointsAreSet()
static lldb::UnwindPlanSP GetRuntimeUnwindPlan(lldb_private::Thread &thread, lldb_private::RegisterContext *regctx, bool &behaves_like_zeroth_frame)
A language runtime may be able to provide a special UnwindPlan for the frame represented by the regis...
virtual llvm::Expected< VTableInfo > GetVTableInfo(ValueObject &in_value, bool check_type)
Get the vtable information for a given value.
virtual llvm::Expected< lldb::addr_t > FixupPointerValue(lldb::addr_t pointer, CompilerType type)
Returns the address of the instance that pointer refers to, where pointer is the value of an object o...
void ModulesDidLoad(const ModuleList &module_list) override
Called when modules have been loaded in the process.
virtual DeclVendor * GetDeclVendor()
virtual lldb::addr_t LookupRuntimeSymbol(llvm::StringRef name)
virtual void SymbolsDidLoad(const ModuleList &module_list)
virtual std::optional< uint64_t > GetTypeBitSize(const CompilerType &compiler_type)
virtual lldb::BreakpointSP CreateErrorBackstopBreakpoint()
Create a breakpoint that catches an error escaping an expression that runs as top-level code,...
virtual bool IsPreferredLanguageRuntimeFor(ValueObject &in_value)
Returns whether this runtime is the preferred runtime for in_value, an object of another language,...
static lldb::BreakpointSP CreateExceptionBreakpoint(Target &target, lldb::LanguageType language, bool catch_bp, bool throw_bp, bool is_internal=false)
virtual bool GetIRPasses(LLVMUserExpression::IRPasses &custom_passes)
static void InitializeCommands(CommandObject *parent)
virtual bool CouldHaveDynamicValue(ValueObject &in_value)=0
virtual llvm::Error GetObjectDescription(Stream &str, Value &value, ExecutionContextScope *exe_scope)=0
virtual llvm::Error GetObjectDescription(Stream &str, ValueObject &object)=0
virtual std::optional< Value > EvaluateEntryValue(StackFrame &frame, llvm::ArrayRef< uint8_t > entry_value, llvm::ArrayRef< uint8_t > &following)
This allows a language runtime to evaluate DW_OP_entry_value(entry_value) in frame without call site ...
virtual lldb::SearchFilterSP CreateExceptionSearchFilter()
virtual CompilerType GetConcreteType(ExecutionContextScope *exe_scope, llvm::StringRef abstract_type_name)
virtual lldb::BreakpointResolverSP CreateExceptionResolver(const lldb::BreakpointSP &bkpt, bool catch_bp, bool throw_bp)=0
virtual std::optional< lldb::ValueObjectSP > GetThrownError(StackFrame &frame, const Value &location)
Given frame, the frame a callee returned to, and location, computed by GetThrownErrorLocation from th...
static lldb::BreakpointPreconditionSP GetExceptionPrecondition(lldb::LanguageType language, bool throw_bp)
A collection class for Module objects.
PluginInterface()=default
A plug-in interface definition class for debugging a process.
Runtime(Process *process)
SearchFilter(const lldb::TargetSP &target_sp)
The basic constructor takes a Target, which gives the space to search.
General Outline: Provides the callback and search depth for the SearchFilter search.
This base class provides an interface to stack frames.
A stream class that can stream formatted output to a file.
std::shared_ptr< Object > ObjectSP
Defines a symbol context baton that can be handed other debug core functions.
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
ValueType
Type that describes Value::m_value.
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
CFAComparison
How the call frame addresses of two frames order them.
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::SearchFilter > SearchFilterSP
std::shared_ptr< lldb_private::BreakpointResolver > BreakpointResolverSP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::BreakpointPrecondition > BreakpointPreconditionSP
std::shared_ptr< lldb_private::UnwindPlan > UnwindPlanSP
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::Module > ModuleSP
Symbol * symbol
Address of the vtable's virtual function table.