[Lldb-commits] [lldb] r180074 - <rdar://problem/13437949>
Enrico Granata
egranata at apple.com
Mon Apr 22 18:13:50 PDT 2013
Author: enrico
Date: Mon Apr 22 20:13:50 2013
New Revision: 180074
URL: http://llvm.org/viewvc/llvm-project?rev=180074&view=rev
Log:
<rdar://problem/13437949>
Making sure that CF*{Array|Dictionary}Ref provide synthetic children correctly.
Modified:
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/NSArray.cpp
lldb/trunk/source/DataFormatters/NSDictionary.cpp
Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=180074&r1=180073&r2=180074&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Mon Apr 22 20:13:50 2013
@@ -900,6 +900,8 @@ FormatManager::LoadObjCFormatters()
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("NSArray"), ScriptedSyntheticChildren::Flags());
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("NSMutableArray"), ScriptedSyntheticChildren::Flags());
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSCFArray"), ScriptedSyntheticChildren::Flags());
+ AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("CFMutableArrayRef"), ScriptedSyntheticChildren::Flags());
+ AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("CFArrayRef"), ScriptedSyntheticChildren::Flags());
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("__NSDictionaryM"), ScriptedSyntheticChildren::Flags());
AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("__NSDictionaryI"), ScriptedSyntheticChildren::Flags());
Modified: lldb/trunk/source/DataFormatters/NSArray.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/NSArray.cpp?rev=180074&r1=180073&r2=180074&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/NSArray.cpp (original)
+++ lldb/trunk/source/DataFormatters/NSArray.cpp Mon Apr 22 20:13:50 2013
@@ -97,10 +97,7 @@ m_data_32(NULL),
m_data_64(NULL)
{
if (valobj_sp)
- {
m_id_type = ClangASTType(valobj_sp->GetClangAST(),valobj_sp->GetClangAST()->ObjCBuiltinIdTy.getAsOpaquePtr());
- Update();
- }
}
size_t
@@ -150,18 +147,12 @@ lldb_private::formatters::NSArrayMSynthe
return false;
m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
Error error;
- if (valobj_sp->IsPointerType())
- {
- valobj_sp = valobj_sp->Dereference(error);
- if (error.Fail() || !valobj_sp)
- return false;
- }
error.Clear();
lldb::ProcessSP process_sp(valobj_sp->GetProcessSP());
if (!process_sp)
return false;
m_ptr_size = process_sp->GetAddressByteSize();
- uint64_t data_location = valobj_sp->GetAddressOf() + m_ptr_size;
+ uint64_t data_location = valobj_sp->GetValueAsUnsigned(0) + m_ptr_size;
if (m_ptr_size == 4)
{
m_data_32 = new DataDescriptor_32();
@@ -211,10 +202,7 @@ m_items(0),
m_data_ptr(0)
{
if (valobj_sp)
- {
m_id_type = ClangASTType(valobj_sp->GetClangAST(),valobj_sp->GetClangAST()->ObjCBuiltinIdTy.getAsOpaquePtr());
- Update();
- }
}
lldb_private::formatters::NSArrayISyntheticFrontEnd::~NSArrayISyntheticFrontEnd ()
@@ -249,18 +237,12 @@ lldb_private::formatters::NSArrayISynthe
return false;
m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
Error error;
- if (valobj_sp->IsPointerType())
- {
- valobj_sp = valobj_sp->Dereference(error);
- if (error.Fail() || !valobj_sp)
- return false;
- }
error.Clear();
lldb::ProcessSP process_sp(valobj_sp->GetProcessSP());
if (!process_sp)
return false;
m_ptr_size = process_sp->GetAddressByteSize();
- uint64_t data_location = valobj_sp->GetAddressOf() + m_ptr_size;
+ uint64_t data_location = valobj_sp->GetValueAsUnsigned(0) + m_ptr_size;
m_items = process_sp->ReadPointerFromMemory(data_location, error);
if (error.Fail())
return false;
Modified: lldb/trunk/source/DataFormatters/NSDictionary.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/NSDictionary.cpp?rev=180074&r1=180073&r2=180074&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/NSDictionary.cpp (original)
+++ lldb/trunk/source/DataFormatters/NSDictionary.cpp Mon Apr 22 20:13:50 2013
@@ -255,8 +255,6 @@ m_data_32(NULL),
m_data_64(NULL),
m_pair_type()
{
- if (valobj_sp)
- Update();
}
lldb_private::formatters::NSDictionaryISyntheticFrontEnd::~NSDictionaryISyntheticFrontEnd ()
@@ -297,23 +295,15 @@ lldb_private::formatters::NSDictionaryIS
ValueObjectSP valobj_sp = m_backend.GetSP();
if (!valobj_sp)
return false;
- if (!valobj_sp)
- return false;
m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
Error error;
- if (valobj_sp->IsPointerType())
- {
- valobj_sp = valobj_sp->Dereference(error);
- if (error.Fail() || !valobj_sp)
- return false;
- }
error.Clear();
lldb::ProcessSP process_sp(valobj_sp->GetProcessSP());
if (!process_sp)
return false;
m_ptr_size = process_sp->GetAddressByteSize();
m_order = process_sp->GetByteOrder();
- uint64_t data_location = valobj_sp->GetAddressOf() + m_ptr_size;
+ uint64_t data_location = valobj_sp->GetValueAsUnsigned(0) + m_ptr_size;
if (m_ptr_size == 4)
{
m_data_32 = new DataDescriptor_32();
@@ -427,8 +417,6 @@ m_data_32(NULL),
m_data_64(NULL),
m_pair_type()
{
- if (valobj_sp)
- Update ();
}
lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::~NSDictionaryMSyntheticFrontEnd ()
@@ -469,23 +457,15 @@ lldb_private::formatters::NSDictionaryMS
m_data_64 = NULL;
if (!valobj_sp)
return false;
- if (!valobj_sp)
- return false;
m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
Error error;
- if (valobj_sp->IsPointerType())
- {
- valobj_sp = valobj_sp->Dereference(error);
- if (error.Fail() || !valobj_sp)
- return false;
- }
error.Clear();
lldb::ProcessSP process_sp(valobj_sp->GetProcessSP());
if (!process_sp)
return false;
m_ptr_size = process_sp->GetAddressByteSize();
m_order = process_sp->GetByteOrder();
- uint64_t data_location = valobj_sp->GetAddressOf() + m_ptr_size;
+ uint64_t data_location = valobj_sp->GetValueAsUnsigned(0) + m_ptr_size;
if (m_ptr_size == 4)
{
m_data_32 = new DataDescriptor_32();
More information about the lldb-commits
mailing list