41 const llvm::Triple &TT) {
44 const FileSpec &module_file_spec = module_sp->GetFileSpec();
45 if (!module_file_spec)
48 if (TT.isOSBinFormatELF())
49 return filename.starts_with(
"libobjc.so");
51 return filename ==
"objc.dll";
56 const llvm::Triple &TT) {
57 std::lock_guard<std::recursive_mutex> guard(modules.
GetMutex());
58 size_t num_modules = modules.
GetSize();
59 for (
size_t i = 0; i < num_modules; i++) {
76 if (TT.getVendor() == llvm::Triple::VendorType::Apple)
83 if (TT.isOSBinFormatELF()) {
89 }
else if (TT.isOSWindows()) {
93 if (objc_mandatory.
GetSize() == 0)
109 return llvm::createStringError(
110 "LLDB's GNUStep runtime does not support object description");
116 return llvm::createStringError(
117 "LLDB's GNUStep runtime does not support object description");
121 static constexpr bool check_cxx =
false;
122 static constexpr bool check_objc =
true;
141 if (type_and_or_name.
HasType()) {
148 if (static_type_flags.
AllSet(eTypeIsPointer))
155 if (static_type_flags.
AllSet(eTypeIsPointer))
156 corrected_name.append(
" *");
159 ret.
SetName(corrected_name.c_str());
166 bool catch_bp,
bool throw_bp) {
170 resolver_sp = std::make_shared<BreakpointResolverName>(
171 bkpt,
"objc_exception_throw", eFunctionNameTypeBase,
177llvm::Expected<std::unique_ptr<UtilityFunction>>
183 const char *function_template = R
"(
185 %s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) {}
188 char empty_function_code[2048];
189 int len = ::snprintf(empty_function_code,
sizeof(empty_function_code),
190 function_template, name.c_str());
192 assert(len < (
int)
sizeof(empty_function_code));
static bool ScanForGNUstepObjCLibraryCandidate(const ModuleList &modules, const llvm::Triple &TT)
static bool CanModuleBeGNUstepObjCLibrary(const ModuleSP &module_sp, const llvm::Triple &TT)
#define LLDB_PLUGIN_DEFINE(PluginName)
A section + offset based address class.
llvm::Triple & GetTriple()
Architecture triple accessor.
Generic representation of a type in a programming language.
bool IsPossibleDynamicType(CompilerType *target_type, bool check_cplusplus, bool check_objc) const
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
A uniqued constant string class.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
const char * GetCString() const
Get the string value as a C string.
"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.
const ConstString & GetFilename() const
Filename string const get accessor.
bool AllSet(ValueType mask) const
Test if all bits in mask are 1 in the current flags.
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)
lldb::ModuleSP m_objc_module_sp
bool ReadObjCLibrary(const lldb::ModuleSP &module_sp) override
GNUstepObjCRuntime(Process *process)
bool IsModuleObjCLibrary(const lldb::ModuleSP &module_sp) override
~GNUstepObjCRuntime() override
static llvm::StringRef GetPluginNameStatic()
lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop_others) override
void UpdateISAToDescriptorMapIfNeeded() 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.
A collection class for Module objects.
std::recursive_mutex & GetMutex() const
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
lldb::ModuleSP GetModuleAtIndex(size_t idx) const
Get the module shared pointer for the module at index idx.
void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
size_t GetSize() const
Gets the size of the module list.
void ReadObjCLibraryIfNeeded(const ModuleList &module_list)
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
A plug-in interface definition class for debugging a process.
Target & GetTarget()
Get the target object pointer for this module.
A stream class that can stream formatted output to a file.
Defines a list of symbol context objects.
uint32_t GetSize() const
Get accessor for a symbol context list size.
llvm::Expected< std::unique_ptr< UtilityFunction > > CreateUtilityFunction(std::string expression, std::string name, lldb::LanguageType language, ExecutionContext &exe_ctx)
Creates and installs a UtilityFunction for the given language.
const ModuleList & GetImages() const
Get accessor for the images for this process.
const ArchSpec & GetArchitecture() const
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
void SetName(ConstString type_name)
CompilerType GetCompilerType() const
ConstString GetName() const
void SetCompilerType(CompilerType compiler_type)
CompilerType GetCompilerType()
ValueType
Type that describes Value::m_value.
#define UNUSED_IF_ASSERT_DISABLED(x)
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
std::shared_ptr< lldb_private::BreakpointResolver > BreakpointResolverSP
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
@ eLanguageTypeC
Non-standardized C, such as K&R.
@ eLanguageTypeObjC
Objective-C.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
std::shared_ptr< lldb_private::Module > ModuleSP