本文整理汇总了C++中ObjCLanguageRuntime::GetClassDescriptorFromISA方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjCLanguageRuntime::GetClassDescriptorFromISA方法的具体用法?C++ ObjCLanguageRuntime::GetClassDescriptorFromISA怎么用?C++ ObjCLanguageRuntime::GetClassDescriptorFromISA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjCLanguageRuntime
的用法示例。
在下文中一共展示了ObjCLanguageRuntime::GetClassDescriptorFromISA方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: descriptor
bool
lldb_private::formatters::ObjCClassSummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options)
{
ProcessSP process_sp = valobj.GetProcessSP();
if (!process_sp)
return false;
ObjCLanguageRuntime* runtime = (ObjCLanguageRuntime*)process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC);
if (!runtime)
return false;
ObjCLanguageRuntime::ClassDescriptorSP descriptor(runtime->GetClassDescriptorFromISA(valobj.GetValueAsUnsigned(0)));
if (!descriptor.get() || !descriptor->IsValid())
return false;
const char* class_name = descriptor->GetClassName().GetCString();
if (!class_name || !*class_name)
return false;
stream.Printf("%s",class_name);
return true;
}
示例2: descriptor
bool
lldb_private::formatters::ObjCClassSummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options)
{
ProcessSP process_sp = valobj.GetProcessSP();
if (!process_sp)
return false;
ObjCLanguageRuntime* runtime = (ObjCLanguageRuntime*)process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC);
if (!runtime)
return false;
ObjCLanguageRuntime::ClassDescriptorSP descriptor(runtime->GetClassDescriptorFromISA(valobj.GetValueAsUnsigned(0)));
if (!descriptor || !descriptor->IsValid())
return false;
ConstString class_name = descriptor->GetClassName();
if (class_name.IsEmpty())
return false;
if (ConstString cs = Mangled(class_name).GetDemangledName(lldb::eLanguageTypeUnknown))
class_name = cs;
stream.Printf("%s",class_name.AsCString("<unknown class>"));
return true;
}