diff options
author | Greg Clayton <gclayton@apple.com> | 2012-12-14 02:15:00 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-12-14 02:15:00 +0000 |
commit | 032805836d90538cbcb0bcdc3befa83aa25f9728 (patch) | |
tree | 19de97e667bdaba5651eb97c7e352a328d9b2e1c /lldb/source/Plugins/SymbolVendor | |
parent | 058b134c9b6c7a299e62e8dc383f8f2d7ce1ff5b (diff) |
Cleaned up the UUID mismatch just printing itself whenever it wants to by allowing an optional feedback stream to be passed along when getting the symbol vendor.
Diffstat (limited to 'lldb/source/Plugins/SymbolVendor')
-rw-r--r-- | lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp | 39 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h | 2 |
2 files changed, 22 insertions, 19 deletions
diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp index d6436649e75..8396d0150a2 100644 --- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp +++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp @@ -45,7 +45,7 @@ SymbolVendorMacOSX::~SymbolVendorMacOSX() static bool -UUIDsMatch(Module *module, ObjectFile *ofile) +UUIDsMatch(Module *module, ObjectFile *ofile, lldb_private::Stream *feedback_strm) { if (module && ofile) { @@ -54,9 +54,12 @@ UUIDsMatch(Module *module, ObjectFile *ofile) if (!ofile->GetUUID(&dsym_uuid)) { - Host::SystemLog (Host::eSystemLogWarning, - "warning: failed to get the uuid for object file: '%s'\n", - ofile->GetFileSpec().GetFilename().GetCString()); + if (feedback_strm) + { + feedback_strm->PutCString("warning: failed to get the uuid for object file: '"); + ofile->GetFileSpec().Dump(feedback_strm); + feedback_strm->PutCString("\n"); + } return false; } @@ -64,18 +67,18 @@ UUIDsMatch(Module *module, ObjectFile *ofile) return true; // Emit some warning messages since the UUIDs do not match! - const FileSpec &m_file_spec = module->GetFileSpec(); - const FileSpec &o_file_spec = ofile->GetFileSpec(); - StreamString ss_m_path, ss_o_path; - m_file_spec.Dump(&ss_m_path); - o_file_spec.Dump(&ss_o_path); - - StreamString ss_m_uuid, ss_o_uuid; - module->GetUUID().Dump(&ss_m_uuid); - dsym_uuid.Dump(&ss_o_uuid); - Host::SystemLog (Host::eSystemLogWarning, - "warning: UUID mismatch detected between module '%s' (%s) and:\n\t'%s' (%s)\n", - ss_m_path.GetData(), ss_m_uuid.GetData(), ss_o_path.GetData(), ss_o_uuid.GetData()); + if (feedback_strm) + { + feedback_strm->PutCString("warning: UUID mismatch detected between modules:\n "); + module->GetUUID().Dump(feedback_strm); + feedback_strm->PutChar(' '); + module->GetFileSpec().Dump(feedback_strm); + feedback_strm->PutCString("\n "); + dsym_uuid.Dump(feedback_strm); + feedback_strm->PutChar(' '); + ofile->GetFileSpec().Dump(feedback_strm); + feedback_strm->EOL(); + } } return false; } @@ -150,7 +153,7 @@ SymbolVendorMacOSX::GetPluginDescriptionStatic() // also allow for finding separate debug information files. //---------------------------------------------------------------------- SymbolVendor* -SymbolVendorMacOSX::CreateInstance (const lldb::ModuleSP &module_sp) +SymbolVendorMacOSX::CreateInstance (const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm) { if (!module_sp) return NULL; @@ -198,7 +201,7 @@ SymbolVendorMacOSX::CreateInstance (const lldb::ModuleSP &module_sp) { DataBufferSP dsym_file_data_sp; dsym_objfile_sp = ObjectFile::FindPlugin(module_sp, &dsym_fspec, 0, dsym_fspec.GetByteSize(), dsym_file_data_sp); - if (UUIDsMatch(module_sp.get(), dsym_objfile_sp.get())) + if (UUIDsMatch(module_sp.get(), dsym_objfile_sp.get(), feedback_strm)) { char dsym_path[PATH_MAX]; if (module_sp->GetSourceMappingList().IsEmpty() && dsym_fspec.GetPath(dsym_path, sizeof(dsym_path))) diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h index 22e72352990..2c16148ace8 100644 --- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h +++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h @@ -32,7 +32,7 @@ public: GetPluginDescriptionStatic(); static lldb_private::SymbolVendor* - CreateInstance (const lldb::ModuleSP &module_sp); + CreateInstance (const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm); //------------------------------------------------------------------ // Constructors and Destructors |