Skip to content

Commit f4a5281

Browse files
authored
Merge pull request #2903 from Teemperor/cherry/a76df78470d7994f73df0353225cbddc463cce63
[lldb] Make the NSSet formatter faster and less prone to infinite rec…
2 parents c0662ed + 4b9365f commit f4a5281

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

lldb/source/Plugins/Language/ObjC/NSSet.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -444,18 +444,12 @@ bool lldb_private::formatters::NSSetISyntheticFrontEnd::Update() {
444444
if (!valobj_sp)
445445
return false;
446446
m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
447-
Status error;
448-
if (valobj_sp->IsPointerType()) {
449-
valobj_sp = valobj_sp->Dereference(error);
450-
if (error.Fail() || !valobj_sp)
451-
return false;
452-
}
453-
error.Clear();
454447
lldb::ProcessSP process_sp(valobj_sp->GetProcessSP());
455448
if (!process_sp)
456449
return false;
457450
m_ptr_size = process_sp->GetAddressByteSize();
458-
uint64_t data_location = valobj_sp->GetAddressOf() + m_ptr_size;
451+
uint64_t data_location = valobj_sp->GetValueAsUnsigned(0) + m_ptr_size;
452+
Status error;
459453
if (m_ptr_size == 4) {
460454
m_data_32 = new DataDescriptor_32();
461455
process_sp->ReadMemory(data_location, m_data_32, sizeof(DataDescriptor_32),
@@ -728,18 +722,12 @@ lldb_private::formatters::
728722
if (!valobj_sp)
729723
return false;
730724
m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
731-
Status error;
732-
if (valobj_sp->IsPointerType()) {
733-
valobj_sp = valobj_sp->Dereference(error);
734-
if (error.Fail() || !valobj_sp)
735-
return false;
736-
}
737-
error.Clear();
738725
lldb::ProcessSP process_sp(valobj_sp->GetProcessSP());
739726
if (!process_sp)
740727
return false;
741728
m_ptr_size = process_sp->GetAddressByteSize();
742-
uint64_t data_location = valobj_sp->GetAddressOf() + m_ptr_size;
729+
uint64_t data_location = valobj_sp->GetValueAsUnsigned(0) + m_ptr_size;
730+
Status error;
743731
if (m_ptr_size == 4) {
744732
m_data_32 = new D32();
745733
process_sp->ReadMemory(data_location, m_data_32, sizeof(D32),

0 commit comments

Comments
 (0)