Skip to content

Commit 0c0ed39

Browse files
authored
[lldb] Don't read firstSubclass and nextSiblingClass from class_rw_t (#171213)
We're considering modifying the ObjC runtime's class_rw_t structure to remove the firstSubclass and nextSiblingClass fields in some cases. LLDB is currently reading those but not actually using them. Stop doing that to avoid issues if they are removed by the runtime. rdar://166084122
1 parent 5236af8 commit 0c0ed39

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,26 +111,23 @@ bool ClassDescriptorV2::class_rw_t::Read(Process *process, lldb::addr_t addr) {
111111
process->GetAddressByteSize());
112112

113113
lldb::offset_t cursor = 0;
114-
115114
m_flags = extractor.GetU32_unchecked(&cursor);
116115
m_version = extractor.GetU32_unchecked(&cursor);
117116
m_ro_ptr = extractor.GetAddress_unchecked(&cursor);
118117
if (ABISP abi_sp = process->GetABI())
119118
m_ro_ptr = abi_sp->FixCodeAddress(m_ro_ptr);
120119
m_method_list_ptr = extractor.GetAddress_unchecked(&cursor);
121120
m_properties_ptr = extractor.GetAddress_unchecked(&cursor);
122-
m_firstSubclass = extractor.GetAddress_unchecked(&cursor);
123-
m_nextSiblingClass = extractor.GetAddress_unchecked(&cursor);
124121

125122
if (m_ro_ptr & 1) {
126123
DataBufferHeap buffer(ptr_size, '\0');
127124
process->ReadMemory(m_ro_ptr ^ 1, buffer.GetBytes(), ptr_size, error);
128125
if (error.Fail())
129126
return false;
130-
cursor = 0;
131127
DataExtractor extractor(buffer.GetBytes(), ptr_size,
132128
process->GetByteOrder(),
133129
process->GetAddressByteSize());
130+
lldb::offset_t cursor = 0;
134131
m_ro_ptr = extractor.GetAddress_unchecked(&cursor);
135132
if (ABISP abi_sp = process->GetABI())
136133
m_ro_ptr = abi_sp->FixCodeAddress(m_ro_ptr);

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ class ClassDescriptorV2 : public ObjCLanguageRuntime::ClassDescriptor {
133133
lldb::addr_t m_properties_ptr;
134134
lldb::addr_t m_protocols_ptr;
135135

136-
ObjCLanguageRuntime::ObjCISA m_firstSubclass;
137-
ObjCLanguageRuntime::ObjCISA m_nextSiblingClass;
138-
139136
bool Read(Process *process, lldb::addr_t addr);
140137
};
141138

0 commit comments

Comments
 (0)