Skip to content

Revert "[AppleObjCRuntimeV2] Force lazily allocated class names to be… #2067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1175,28 +1175,6 @@ AppleObjCRuntimeV2::GetClassDescriptorFromISA(ObjCISA isa) {
return class_descriptor_sp;
}

static std::pair<bool, ConstString> ObjCGetClassNameRaw(
AppleObjCRuntime::ObjCISA isa,
Process *process) {
StreamString expr_string;
std::string input = std::to_string(isa);
expr_string.Printf("(const char *)objc_debug_class_getNameRaw(%s)",
input.c_str());

ValueObjectSP result_sp;
EvaluateExpressionOptions eval_options;
eval_options.SetLanguage(lldb::eLanguageTypeObjC);
eval_options.SetResultIsInternal(true);
eval_options.SetGenerateDebugInfo(true);
eval_options.SetTimeout(process->GetUtilityExpressionTimeout());
auto eval_result = process->GetTarget().EvaluateExpression(
expr_string.GetData(),
process->GetThreadList().GetSelectedThread()->GetSelectedFrame().get(),
result_sp, eval_options);
ConstString type_name(result_sp->GetSummaryAsCString());
return std::make_pair(eval_result == eExpressionCompleted, type_name);
}

ObjCLanguageRuntime::ClassDescriptorSP
AppleObjCRuntimeV2::GetClassDescriptor(ValueObject &valobj) {
ClassDescriptorSP objc_class_sp;
Expand Down Expand Up @@ -1232,10 +1210,7 @@ AppleObjCRuntimeV2::GetClassDescriptor(ValueObject &valobj) {
return objc_class_sp;

objc_class_sp = GetClassDescriptorFromISA(isa);

if (objc_class_sp)
return objc_class_sp;
else {
if (isa && !objc_class_sp) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS |
LIBLLDB_LOG_TYPES));
LLDB_LOGF(log,
Expand All @@ -1244,13 +1219,6 @@ AppleObjCRuntimeV2::GetClassDescriptor(ValueObject &valobj) {
"not in class descriptor cache 0x%" PRIx64,
isa_pointer, isa);
}

ClassDescriptorSP descriptor_sp(new ClassDescriptorV2(*this, isa, nullptr));
auto resolved = ObjCGetClassNameRaw(isa, process);
if (resolved.first == true) {
AddClass(isa, descriptor_sp, resolved.second.AsCString());
objc_class_sp = descriptor_sp;
}
return objc_class_sp;
}

Expand Down