LLDB  mainline
ItaniumABILanguageRuntime.h
Go to the documentation of this file.
1 //===-- ItaniumABILanguageRuntime.h -----------------------------*- C++ -*-===//
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_ITANIUMABI_ITANIUMABILANGUAGERUNTIME_H
10 #define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_ITANIUMABI_ITANIUMABILANGUAGERUNTIME_H
11 
12 #include <map>
13 #include <mutex>
14 #include <vector>
15 
17 #include "lldb/Core/Value.h"
18 #include "lldb/Symbol/Type.h"
20 #include "lldb/lldb-private.h"
21 
23 
24 namespace lldb_private {
25 
27 public:
28  ~ItaniumABILanguageRuntime() override = default;
29 
30  // Static Functions
31  static void Initialize();
32 
33  static void Terminate();
34 
36  CreateInstance(Process *process, lldb::LanguageType language);
37 
38  static llvm::StringRef GetPluginNameStatic() { return "itanium"; }
39 
40  static char ID;
41 
42  bool isA(const void *ClassID) const override {
43  return ClassID == &ID || CPPLanguageRuntime::isA(ClassID);
44  }
45 
46  static bool classof(const LanguageRuntime *runtime) {
47  return runtime->isA(&ID);
48  }
49 
51  lldb::DynamicValueType use_dynamic,
52  TypeAndOrName &class_type_or_name,
53  Address &address,
54  Value::ValueType &value_type) override;
55 
56  TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name,
57  ValueObject &static_value) override;
58 
59  bool CouldHaveDynamicValue(ValueObject &in_value) override;
60 
61  void SetExceptionBreakpoints() override;
62 
63  void ClearExceptionBreakpoints() override;
64 
65  bool ExceptionBreakpointsAreSet() override;
66 
67  bool ExceptionBreakpointsExplainStop(lldb::StopInfoSP stop_reason) override;
68 
69  lldb::BreakpointResolverSP
70  CreateExceptionResolver(const lldb::BreakpointSP &bkpt,
71  bool catch_bp, bool throw_bp) override;
72 
73  lldb::SearchFilterSP CreateExceptionSearchFilter() override;
74 
75  lldb::ValueObjectSP GetExceptionObjectForThread(
76  lldb::ThreadSP thread_sp) override;
77 
78  // PluginInterface protocol
79  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
80 
81 protected:
82  lldb::BreakpointResolverSP
83  CreateExceptionResolver(const lldb::BreakpointSP &bkpt,
84  bool catch_bp, bool throw_bp, bool for_expressions);
85 
86  lldb::BreakpointSP CreateExceptionBreakpoint(bool catch_bp, bool throw_bp,
87  bool for_expressions,
88  bool is_internal);
89 
90 private:
91  typedef std::map<lldb_private::Address, TypeAndOrName> DynamicTypeCache;
92 
94  : // Call CreateInstance instead.
97 
98  lldb::BreakpointSP m_cxx_exception_bp_sp;
101 
103  lldb::addr_t original_ptr,
104  lldb::addr_t vtable_addr);
105 
107 
108  void SetDynamicTypeInfo(const lldb_private::Address &vtable_addr,
109  const TypeAndOrName &type_info);
110 };
111 
112 } // namespace lldb_private
113 
114 #endif // LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_ITANIUMABI_ITANIUMABILANGUAGERUNTIME_H
lldb_private::ItaniumABILanguageRuntime::m_dynamic_type_map_mutex
std::mutex m_dynamic_type_map_mutex
Definition: ItaniumABILanguageRuntime.h:100
lldb_private::ItaniumABILanguageRuntime::CreateExceptionBreakpoint
lldb::BreakpointSP CreateExceptionBreakpoint(bool catch_bp, bool throw_bp, bool for_expressions, bool is_internal)
Definition: ItaniumABILanguageRuntime.cpp:460
lldb_private::ItaniumABILanguageRuntime::CreateInstance
static lldb_private::LanguageRuntime * CreateInstance(Process *process, lldb::LanguageType language)
Definition: ItaniumABILanguageRuntime.cpp:304
lldb_private::Process
Definition: Process.h:341
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
BreakpointResolver.h
lldb_private::CPPLanguageRuntime::isA
bool isA(const void *ClassID) const override
Definition: CPPLanguageRuntime.h:45
lldb_private::ItaniumABILanguageRuntime::ClearExceptionBreakpoints
void ClearExceptionBreakpoints() override
Definition: ItaniumABILanguageRuntime.cpp:495
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::LanguageRuntime::isA
virtual bool isA(const void *ClassID) const
Definition: LanguageRuntime.h:173
lldb_private::ItaniumABILanguageRuntime::GetPluginName
llvm::StringRef GetPluginName() override
Definition: ItaniumABILanguageRuntime.h:79
lldb_private::ItaniumABILanguageRuntime::GetPluginNameStatic
static llvm::StringRef GetPluginNameStatic()
Definition: ItaniumABILanguageRuntime.h:38
lldb_private::ItaniumABILanguageRuntime::SetDynamicTypeInfo
void SetDynamicTypeInfo(const lldb_private::Address &vtable_addr, const TypeAndOrName &type_info)
Definition: ItaniumABILanguageRuntime.cpp:599
lldb_private::ItaniumABILanguageRuntime::m_cxx_exception_bp_sp
lldb::BreakpointSP m_cxx_exception_bp_sp
Definition: ItaniumABILanguageRuntime.h:98
lldb_private::ItaniumABILanguageRuntime::isA
bool isA(const void *ClassID) const override
Definition: ItaniumABILanguageRuntime.h:42
lldb_private::ItaniumABILanguageRuntime::m_dynamic_type_map
DynamicTypeCache m_dynamic_type_map
Definition: ItaniumABILanguageRuntime.h:99
lldb_private::ItaniumABILanguageRuntime
Definition: ItaniumABILanguageRuntime.h:26
lldb_private::ItaniumABILanguageRuntime::CreateExceptionSearchFilter
lldb::SearchFilterSP CreateExceptionSearchFilter() override
Definition: ItaniumABILanguageRuntime.cpp:447
Type.h
lldb_private::Value::ValueType
ValueType
Type that describes Value::m_value.
Definition: Value.h:41
lldb_private::ItaniumABILanguageRuntime::GetDynamicTypeAndAddress
bool GetDynamicTypeAndAddress(ValueObject &in_value, lldb::DynamicValueType use_dynamic, TypeAndOrName &class_type_or_name, Address &address, Value::ValueType &value_type) override
Definition: ItaniumABILanguageRuntime.cpp:185
lldb::DynamicValueType
DynamicValueType
Definition: lldb-enumerations.h:494
lldb_private::LanguageRuntime
Definition: LanguageRuntime.h:60
lldb_private::ItaniumABILanguageRuntime::ID
static char ID
Definition: ItaniumABILanguageRuntime.h:40
CPPLanguageRuntime.h
lldb-private.h
lldb_private::ItaniumABILanguageRuntime::ExceptionBreakpointsAreSet
bool ExceptionBreakpointsAreSet() override
Definition: ItaniumABILanguageRuntime.cpp:504
lldb_private::ItaniumABILanguageRuntime::Terminate
static void Terminate()
Definition: ItaniumABILanguageRuntime.cpp:404
lldb_private::ItaniumABILanguageRuntime::FixUpDynamicType
TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name, ValueObject &static_value) override
Definition: ItaniumABILanguageRuntime.cpp:269
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb_private::ItaniumABILanguageRuntime::ItaniumABILanguageRuntime
ItaniumABILanguageRuntime(Process *process)
Definition: ItaniumABILanguageRuntime.h:93
lldb_private::Address
Definition: Address.h:59
lldb_private::ItaniumABILanguageRuntime::GetTypeInfoFromVTableAddress
TypeAndOrName GetTypeInfoFromVTableAddress(ValueObject &in_value, lldb::addr_t original_ptr, lldb::addr_t vtable_addr)
Definition: ItaniumABILanguageRuntime.cpp:56
LanguageRuntime.h
lldb_private::ItaniumABILanguageRuntime::~ItaniumABILanguageRuntime
~ItaniumABILanguageRuntime() override=default
lldb_private::ItaniumABILanguageRuntime::SetExceptionBreakpoints
void SetExceptionBreakpoints() override
Definition: ItaniumABILanguageRuntime.cpp:473
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ItaniumABILanguageRuntime::GetDynamicTypeInfo
TypeAndOrName GetDynamicTypeInfo(const lldb_private::Address &vtable_addr)
Definition: ItaniumABILanguageRuntime.cpp:589
lldb_private::ItaniumABILanguageRuntime::ExceptionBreakpointsExplainStop
bool ExceptionBreakpointsExplainStop(lldb::StopInfoSP stop_reason) override
Definition: ItaniumABILanguageRuntime.cpp:508
lldb_private::ItaniumABILanguageRuntime::CouldHaveDynamicValue
bool CouldHaveDynamicValue(ValueObject &in_value) override
Definition: ItaniumABILanguageRuntime.cpp:49
lldb_private::ItaniumABILanguageRuntime::GetExceptionObjectForThread
lldb::ValueObjectSP GetExceptionObjectForThread(lldb::ThreadSP thread_sp) override
Definition: ItaniumABILanguageRuntime.cpp:521
lldb_private::TypeAndOrName
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
Definition: Type.h:394
lldb_private::ItaniumABILanguageRuntime::CreateExceptionResolver
lldb::BreakpointResolverSP CreateExceptionResolver(const lldb::BreakpointSP &bkpt, bool catch_bp, bool throw_bp) override
lldb_private::ItaniumABILanguageRuntime::classof
static bool classof(const LanguageRuntime *runtime)
Definition: ItaniumABILanguageRuntime.h:46
lldb_private::CPPLanguageRuntime
Definition: CPPLanguageRuntime.h:22
lldb_private::ItaniumABILanguageRuntime::Initialize
static void Initialize()
Definition: ItaniumABILanguageRuntime.cpp:395
Value.h
lldb_private::ItaniumABILanguageRuntime::DynamicTypeCache
std::map< lldb_private::Address, TypeAndOrName > DynamicTypeCache
Definition: ItaniumABILanguageRuntime.h:91