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 | 136dff8725dfeca54101c822b9fb8941799827db (patch) | |
| tree | 87c5876c75efb7a9ea362d3659b0edf73fd273f2 /lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp | |
| parent | fff17252a14d24b4140fb279deb789c4846a43c2 (diff) | |
| download | bcm5719-llvm-136dff8725dfeca54101c822b9fb8941799827db.tar.gz bcm5719-llvm-136dff8725dfeca54101c822b9fb8941799827db.zip | |
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.
llvm-svn: 170174
Diffstat (limited to 'lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp')
| -rw-r--r-- | lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp | 39 |
1 files changed, 21 insertions, 18 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))) |

