LLDB mainline
GNUstepObjCRuntime.h
Go to the documentation of this file.
1//===-- GNUstepObjCRuntime.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_OBJC_GNUSTEPOBJCRUNTIME_GNUSTEPOBJCRUNTIME_H
10#define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_GNUSTEPOBJCRUNTIME_GNUSTEPOBJCRUNTIME_H
11
13#include "lldb/lldb-private.h"
14
16
17#include "llvm/ADT/StringRef.h"
18#include "llvm/Support/Error.h"
19
20#include <optional>
21
22namespace lldb_private {
23
25public:
27
28 //
29 // PluginManager, PluginInterface and LLVM RTTI implementation
30 //
31
32 static char ID;
33
34 static void Initialize();
35
36 static void Terminate();
37
39 CreateInstance(Process *process, lldb::LanguageType language);
40
41 static llvm::StringRef GetPluginNameStatic() {
42 return "gnustep-objc-libobjc2";
43 }
44
45 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
46
47 void ModulesDidLoad(const ModuleList &module_list) override;
48
49 bool isA(const void *ClassID) const override {
50 return ClassID == &ID || ObjCLanguageRuntime::isA(ClassID);
51 }
52
53 static bool classof(const LanguageRuntime *runtime) {
54 return runtime->isA(&ID);
55 }
56
57 //
58 // LanguageRuntime implementation
59 //
60 llvm::Error GetObjectDescription(Stream &str, Value &value,
61 ExecutionContextScope *exe_scope) override;
62
63 llvm::Error GetObjectDescription(Stream &str, ValueObject &object) override;
64
65 bool CouldHaveDynamicValue(ValueObject &in_value) override;
66
68 lldb::DynamicValueType use_dynamic,
69 TypeAndOrName &class_type_or_name,
70 Address &address,
71 Value::ValueType &value_type) override;
72
73 TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name,
74 ValueObject &static_value) override;
75
77 CreateExceptionResolver(const lldb::BreakpointSP &bkpt, bool catch_bp,
78 bool throw_bp) override;
79
81 bool stop_others) override;
82
83 //
84 // ObjCLanguageRuntime implementation
85 //
86
87 bool IsModuleObjCLibrary(const lldb::ModuleSP &module_sp) override;
88
89 bool ReadObjCLibrary(const lldb::ModuleSP &module_sp) override;
90
91 bool HasReadObjCLibrary() override { return m_objc_module_sp != nullptr; }
92
93 llvm::Expected<std::unique_ptr<UtilityFunction>>
94 CreateObjectChecker(std::string name, ExecutionContext &exe_ctx) override;
95
98 }
99
100 void UpdateISAToDescriptorMapIfNeeded() override;
101
102protected:
103 // Call CreateInstance instead.
104 GNUstepObjCRuntime(Process *process);
105
107};
108
109} // namespace lldb_private
110
111#endif // LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_GNUSTEPOBJCRUNTIME_GNUSTEPOBJCRUNTIME_H
A section + offset based address class.
Definition: Address.h:62
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
bool CouldHaveDynamicValue(ValueObject &in_value) override
bool GetDynamicTypeAndAddress(ValueObject &in_value, lldb::DynamicValueType use_dynamic, TypeAndOrName &class_type_or_name, Address &address, Value::ValueType &value_type) override
llvm::Expected< std::unique_ptr< UtilityFunction > > CreateObjectChecker(std::string name, ExecutionContext &exe_ctx) override
TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name, ValueObject &static_value) override
static lldb_private::LanguageRuntime * CreateInstance(Process *process, lldb::LanguageType language)
bool ReadObjCLibrary(const lldb::ModuleSP &module_sp) override
llvm::StringRef GetPluginName() override
bool isA(const void *ClassID) const override
bool IsModuleObjCLibrary(const lldb::ModuleSP &module_sp) override
static bool classof(const LanguageRuntime *runtime)
static llvm::StringRef GetPluginNameStatic()
lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop_others) override
ObjCRuntimeVersions GetRuntimeVersion() const override
llvm::Error GetObjectDescription(Stream &str, Value &value, ExecutionContextScope *exe_scope) override
lldb::BreakpointResolverSP CreateExceptionResolver(const lldb::BreakpointSP &bkpt, bool catch_bp, bool throw_bp) override
void ModulesDidLoad(const ModuleList &module_list) override
Called when modules have been loaded in the process.
virtual bool isA(const void *ClassID) const
A collection class for Module objects.
Definition: ModuleList.h:103
bool isA(const void *ClassID) const override
A plug-in interface definition class for debugging a process.
Definition: Process.h:343
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
Definition: lldb-forward.h:453
std::shared_ptr< lldb_private::BreakpointResolver > BreakpointResolverSP
Definition: lldb-forward.h:328
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
Definition: lldb-forward.h:321
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:373