From 39497e9f5bd9c82c15b4d1798976e5daad5c7767 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Fri, 24 Jul 2015 23:40:32 +0000 Subject: [PATCH] Make sure we resolve ~ in paths coming from the plist in a dSYM before adding them to the path remappings. Also don't add the paths to the path mapping when DebugSymbols tells up about files, since we'll just do that again when we read in the dSYM. llvm-svn: 243181 --- lldb/source/Host/macosx/Symbols.cpp | 37 ++++------------------ .../SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp | 5 +++ 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/lldb/source/Host/macosx/Symbols.cpp b/lldb/source/Host/macosx/Symbols.cpp index db05b1b..a86a773 100644 --- a/lldb/source/Host/macosx/Symbols.cpp +++ b/lldb/source/Host/macosx/Symbols.cpp @@ -133,39 +133,16 @@ LocateMacOSXFilesUsingDebugSymbols } } - CFCReleaser dict(::DBGCopyDSYMPropertyLists (dsym_url.get())); - CFDictionaryRef uuid_dict = NULL; - if (dict.get()) - { - CFCString uuid_cfstr (uuid->GetAsString().c_str()); - uuid_dict = static_cast(::CFDictionaryGetValue (dict.get(), uuid_cfstr.get())); - if (uuid_dict) - { - - CFStringRef actual_src_cfpath = static_cast(::CFDictionaryGetValue (uuid_dict, CFSTR("DBGSourcePath"))); - if (actual_src_cfpath) - { - CFStringRef build_src_cfpath = static_cast(::CFDictionaryGetValue (uuid_dict, CFSTR("DBGBuildSourcePath"))); - if (build_src_cfpath) - { - char actual_src_path[PATH_MAX]; - char build_src_path[PATH_MAX]; - ::CFStringGetFileSystemRepresentation (actual_src_cfpath, actual_src_path, sizeof(actual_src_path)); - ::CFStringGetFileSystemRepresentation (build_src_cfpath, build_src_path, sizeof(build_src_path)); - if (actual_src_path[0] == '~') - { - FileSpec resolved_source_path(actual_src_path, true); - resolved_source_path.GetPath(actual_src_path, sizeof(actual_src_path)); - } - module_spec.GetSourceMappingList().Append (ConstString(build_src_path), ConstString(actual_src_path), true); - } - } - } - } - if (out_exec_fspec) { bool success = false; + CFCReleaser dict(::DBGCopyDSYMPropertyLists (dsym_url.get())); + CFDictionaryRef uuid_dict = NULL; + if (dict.get()) + { + CFCString uuid_cfstr (uuid->GetAsString().c_str()); + uuid_dict = static_cast(::CFDictionaryGetValue (dict.get(), uuid_cfstr.get())); + } if (uuid_dict) { CFStringRef exec_cf_path = static_cast(::CFDictionaryGetValue (uuid_dict, CFSTR("DBGSymbolRichExecutable"))); diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp index f2d1f81..7d21fbc 100644 --- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp +++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp @@ -204,6 +204,11 @@ SymbolVendorMacOSX::CreateInstance (const lldb::ModuleSP &module_sp, lldb_privat plist.GetValueAsString("DBGSourcePath", DBGSourcePath); if (!DBGBuildSourcePath.empty() && !DBGSourcePath.empty()) { + if (DBGSourcePath[0] == '~') + { + FileSpec resolved_source_path(DBGSourcePath.c_str(), true); + DBGSourcePath = resolved_source_path.GetPath(); + } module_sp->GetSourceMappingList().Append (ConstString(DBGBuildSourcePath), ConstString(DBGSourcePath), true); } } -- 2.7.4