When deciding whether to use the source remapping dictionary from

a dSYM per-uuid plist, only use it when the DBGVersion key has a
value of 2 or greater.

<rdar://problem/28889578> 
<rdar://problem/29131339> 

llvm-svn: 286335
This commit is contained in:
Jason Molenda 2016-11-09 03:42:12 +00:00
parent 48c84f9596
commit 73184de2d3
2 changed files with 25 additions and 9 deletions

View File

@ -350,15 +350,22 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
cf_dict = (CFDictionaryRef)CFDictionaryGetValue(
(CFDictionaryRef)uuid_dict, CFSTR("DBGSourcePathRemapping"));
if (cf_dict && CFGetTypeID(cf_dict) == CFDictionaryGetTypeID()) {
// If we see DBGVersion with any kind of value, this is a new style
// If we see DBGVersion with a value of 2 or higher, this is a new style
// DBGSourcePathRemapping dictionary
bool new_style_source_remapping_dictionary = false;
std::string original_DBGSourcePath_value = DBGSourcePath;
const void *version_value;
version_value =
CFDictionaryGetValue((CFDictionaryRef)uuid_dict, CFSTR("DBGVersion"));
if (version_value)
new_style_source_remapping_dictionary = true;
cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
CFSTR("DBGVersion"));
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
std::string version;
CFCString::FileSystemRepresentation(cf_str, version);
if (!version.empty() && isdigit(version[0])) {
int version_number = atoi(version.c_str());
if (version_number > 1) {
new_style_source_remapping_dictionary = true;
}
}
}
CFIndex kv_pair_count = CFDictionaryGetCount((CFDictionaryRef)uuid_dict);
if (kv_pair_count > 0) {

View File

@ -209,8 +209,7 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
// DBGSourcePath
// values were incorrect. If we have a newer style
// DBGSourcePathRemapping, there will be a DBGVersion
// key in the plist
// (we don't care about the value at this point).
// key in the plist with version 2 or higher.
//
// If this is an old style DBGSourcePathRemapping,
// ignore the
@ -221,7 +220,17 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
std::string original_DBGSourcePath_value =
DBGSourcePath;
if (plist_sp->GetAsDictionary()->HasKey("DBGVersion")) {
new_style_source_remapping_dictionary = true;
std::string version_string =
plist_sp->GetAsDictionary()
->GetValueForKey("DBGVersion")
->GetStringValue("");
if (!version_string.empty() &&
isdigit(version_string[0])) {
int version_number = atoi(version_string.c_str());
if (version_number > 1) {
new_style_source_remapping_dictionary = true;
}
}
}
StructuredData::Dictionary *remappings_dict =