Skip to content

Commit 5adf61b

Browse files
committed
Revert "[AppleObjCRuntimeV2] Force lazily allocated class names to be resolved."
We're no longer convinced that this is needed and we have no test coverage to disprove that. Backing out of this change until we're convinced otherwise. (cherry picked from commit 49c84fd)
1 parent de224aa commit 5adf61b

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

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

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,28 +1175,6 @@ AppleObjCRuntimeV2::GetClassDescriptorFromISA(ObjCISA isa) {
11751175
return class_descriptor_sp;
11761176
}
11771177

1178-
static std::pair<bool, ConstString> ObjCGetClassNameRaw(
1179-
AppleObjCRuntime::ObjCISA isa,
1180-
Process *process) {
1181-
StreamString expr_string;
1182-
std::string input = std::to_string(isa);
1183-
expr_string.Printf("(const char *)objc_debug_class_getNameRaw(%s)",
1184-
input.c_str());
1185-
1186-
ValueObjectSP result_sp;
1187-
EvaluateExpressionOptions eval_options;
1188-
eval_options.SetLanguage(lldb::eLanguageTypeObjC);
1189-
eval_options.SetResultIsInternal(true);
1190-
eval_options.SetGenerateDebugInfo(true);
1191-
eval_options.SetTimeout(process->GetUtilityExpressionTimeout());
1192-
auto eval_result = process->GetTarget().EvaluateExpression(
1193-
expr_string.GetData(),
1194-
process->GetThreadList().GetSelectedThread()->GetSelectedFrame().get(),
1195-
result_sp, eval_options);
1196-
ConstString type_name(result_sp->GetSummaryAsCString());
1197-
return std::make_pair(eval_result == eExpressionCompleted, type_name);
1198-
}
1199-
12001178
ObjCLanguageRuntime::ClassDescriptorSP
12011179
AppleObjCRuntimeV2::GetClassDescriptor(ValueObject &valobj) {
12021180
ClassDescriptorSP objc_class_sp;
@@ -1232,10 +1210,7 @@ AppleObjCRuntimeV2::GetClassDescriptor(ValueObject &valobj) {
12321210
return objc_class_sp;
12331211

12341212
objc_class_sp = GetClassDescriptorFromISA(isa);
1235-
1236-
if (objc_class_sp)
1237-
return objc_class_sp;
1238-
else {
1213+
if (isa && !objc_class_sp) {
12391214
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS |
12401215
LIBLLDB_LOG_TYPES));
12411216
LLDB_LOGF(log,
@@ -1244,13 +1219,6 @@ AppleObjCRuntimeV2::GetClassDescriptor(ValueObject &valobj) {
12441219
"not in class descriptor cache 0x%" PRIx64,
12451220
isa_pointer, isa);
12461221
}
1247-
1248-
ClassDescriptorSP descriptor_sp(new ClassDescriptorV2(*this, isa, nullptr));
1249-
auto resolved = ObjCGetClassNameRaw(isa, process);
1250-
if (resolved.first == true) {
1251-
AddClass(isa, descriptor_sp, resolved.second.AsCString());
1252-
objc_class_sp = descriptor_sp;
1253-
}
12541222
return objc_class_sp;
12551223
}
12561224

0 commit comments

Comments
 (0)