LLDB mainline
CPPLanguageRuntime.h
Go to the documentation of this file.
1//===-- CPPLanguageRuntime.h
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_CPPLANGUAGERUNTIME_H
10#define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_CPPLANGUAGERUNTIME_H
11
12#include <vector>
13
14#include "llvm/ADT/StringMap.h"
15
16#include "ItaniumABIRuntime.h"
19#include "lldb/lldb-private.h"
20
21namespace lldb_private {
22
24public:
31
40
43
44 static char ID;
45
46 static void Initialize();
47
48 static void Terminate();
49
51 CreateInstance(Process *process, lldb::LanguageType language);
52
53 static llvm::StringRef GetPluginNameStatic() {
54 return "cpp-language-runtime";
55 }
56
57 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
58
59 bool isA(const void *ClassID) const override {
60 return ClassID == &ID || LanguageRuntime::isA(ClassID);
61 }
62
63 static bool classof(const LanguageRuntime *runtime) {
64 return runtime->isA(&ID);
65 }
66
70
71 static CPPLanguageRuntime *Get(Process &process) {
72 return llvm::cast_or_null<CPPLanguageRuntime>(
74 }
75
76 llvm::Error GetObjectDescription(Stream &str, ValueObject &object) override;
77
78 llvm::Error GetObjectDescription(Stream &str, Value &value,
79 ExecutionContextScope *exe_scope) override;
80
81 /// Obtain a ThreadPlan to get us into C++ constructs such as std::function.
82 ///
83 /// \param[in] thread
84 /// Current thrad of execution.
85 ///
86 /// \param[in] stop_others
87 /// True if other threads should pause during execution.
88 ///
89 /// \return
90 /// A ThreadPlan Shared pointer
92 bool stop_others) override;
93
94 bool IsAllowedRuntimeValue(ConstString name) override;
95
96 bool IsSymbolARuntimeThunk(const Symbol &symbol) override;
97
98 llvm::Expected<LanguageRuntime::VTableInfo>
99 GetVTableInfo(ValueObject &in_value, bool check_type) override;
100
102 lldb::DynamicValueType use_dynamic,
103 TypeAndOrName &class_type_or_name,
104 Address &address, Value::ValueType &value_type,
105 llvm::ArrayRef<uint8_t> &local_buffer) override;
106
107 TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name,
108 ValueObject &static_value) override;
109
110 bool CouldHaveDynamicValue(ValueObject &in_value) override;
111
112 void SetExceptionBreakpoints() override;
113
114 void ClearExceptionBreakpoints() override;
115
116 bool ExceptionBreakpointsAreSet() override;
117
118 bool ExceptionBreakpointsExplainStop(lldb::StopInfoSP stop_reason) override;
119
121 CreateExceptionResolver(const lldb::BreakpointSP &bkpt, bool catch_bp,
122 bool throw_bp) override;
123
125
128
129private:
130 CPPLanguageRuntime(Process *process);
131
133 CreateExceptionResolver(const lldb::BreakpointSP &bkpt, bool catch_bp,
134 bool throw_bp, bool for_expressions);
135
136 lldb::BreakpointSP CreateExceptionBreakpoint(bool catch_bp, bool throw_bp,
137 bool for_expressions,
138 bool is_internal);
139
141 llvm::StringMap<CPPLanguageRuntime::LibCppStdFunctionCallableInfo>;
142
144
147};
148
149} // namespace lldb_private
150
151#endif // LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_CPPLANGUAGERUNTIME_H
A section + offset based address class.
Definition Address.h:62
llvm::Expected< LanguageRuntime::VTableInfo > GetVTableInfo(ValueObject &in_value, bool check_type) override
Get the vtable information for a given value.
TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name, ValueObject &static_value) override
bool CouldHaveDynamicValue(ValueObject &in_value) override
lldb::BreakpointSP CreateExceptionBreakpoint(bool catch_bp, bool throw_bp, bool for_expressions, bool is_internal)
static lldb_private::LanguageRuntime * CreateInstance(Process *process, lldb::LanguageType language)
llvm::Error GetObjectDescription(Stream &str, ValueObject &object) override
static bool classof(const LanguageRuntime *runtime)
lldb::SearchFilterSP CreateExceptionSearchFilter() override
lldb::ValueObjectSP GetExceptionObjectForThread(lldb::ThreadSP thread_sp) override
llvm::StringMap< CPPLanguageRuntime::LibCppStdFunctionCallableInfo > OperatorStringToCallableInfoMap
bool IsSymbolARuntimeThunk(const Symbol &symbol) override
bool IsAllowedRuntimeValue(ConstString name) override
Identify whether a name is a runtime value that should not be hidden by from the user interface.
LibCppStdFunctionCallableInfo FindLibCppStdFunctionCallableInfo(lldb::ValueObjectSP &valobj_sp)
llvm::StringRef GetPluginName() override
lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop_others) override
Obtain a ThreadPlan to get us into C++ constructs such as std::function.
bool isA(const void *ClassID) const override
static CPPLanguageRuntime * Get(Process &process)
lldb::BreakpointResolverSP CreateExceptionResolver(const lldb::BreakpointSP &bkpt, bool catch_bp, bool throw_bp) override
lldb::LanguageType GetLanguageType() const override
OperatorStringToCallableInfoMap CallableLookupCache
static llvm::StringRef GetPluginNameStatic()
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) override
This call should return true if it could set the name and/or the type Sets address to the address of ...
bool ExceptionBreakpointsExplainStop(lldb::StopInfoSP stop_reason) override
A uniqued constant string class.
Definition ConstString.h:40
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
virtual bool isA(const void *ClassID) const
A plug-in interface definition class for debugging a process.
Definition Process.h:354
LanguageRuntime * GetLanguageRuntime(lldb::LanguageType language)
Definition Process.cpp:1483
A stream class that can stream formatted output to a file.
Definition Stream.h:28
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
Definition Type.h:779
ValueType
Type that describes Value::m_value.
Definition Value.h:41
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
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.
@ eLanguageTypeC_plus_plus
ISO C++:1998.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
uint64_t addr_t
Definition lldb-types.h:80
A line table entry class.
Definition LineEntry.h:21