We have two sources for path remapping information that we get out
of a dSYM per-uuid plist that may be present (dsymutil does not create this plist, it is only added after the fact by additional tools) -- either the DBGBuildSourcePath + DBGSourcePath pair of k-v entries which give us the build-time and debug-time remapping, or the newer DBGSourcePathRemapping dictionary which may give us multiple remappings. I'm changing the order that we process these & add them to the list of source remappings. If the DBGSourcePathRemapping dict is present, it should be the first entries we will try. <rdar://problem/36481989> llvm-svn: 322418
This commit is contained in:
parent
0d29aaf628
commit
9f0115fe1c
|
@ -333,28 +333,9 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
|
|||
std::string DBGBuildSourcePath;
|
||||
std::string DBGSourcePath;
|
||||
|
||||
cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
|
||||
CFSTR("DBGBuildSourcePath"));
|
||||
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
|
||||
CFCString::FileSystemRepresentation(cf_str, DBGBuildSourcePath);
|
||||
}
|
||||
|
||||
cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
|
||||
CFSTR("DBGSourcePath"));
|
||||
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
|
||||
CFCString::FileSystemRepresentation(cf_str, DBGSourcePath);
|
||||
}
|
||||
|
||||
if (!DBGBuildSourcePath.empty() && !DBGSourcePath.empty()) {
|
||||
if (DBGSourcePath[0] == '~') {
|
||||
FileSpec resolved_source_path(DBGSourcePath.c_str(), true);
|
||||
DBGSourcePath = resolved_source_path.GetPath();
|
||||
}
|
||||
module_spec.GetSourceMappingList().Append(
|
||||
ConstString(DBGBuildSourcePath.c_str()),
|
||||
ConstString(DBGSourcePath.c_str()), true);
|
||||
}
|
||||
|
||||
// If DBGVersion value 2 or higher, look for
|
||||
// DBGSourcePathRemapping dictionary and append the key-value pairs
|
||||
// to our remappings.
|
||||
cf_dict = (CFDictionaryRef)CFDictionaryGetValue(
|
||||
(CFDictionaryRef)uuid_dict, CFSTR("DBGSourcePathRemapping"));
|
||||
if (cf_dict && CFGetTypeID(cf_dict) == CFDictionaryGetTypeID()) {
|
||||
|
@ -439,6 +420,32 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
|
|||
free(values);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If we have a DBGBuildSourcePath + DBGSourcePath pair,
|
||||
// append them to the source remappings list.
|
||||
|
||||
cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
|
||||
CFSTR("DBGBuildSourcePath"));
|
||||
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
|
||||
CFCString::FileSystemRepresentation(cf_str, DBGBuildSourcePath);
|
||||
}
|
||||
|
||||
cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
|
||||
CFSTR("DBGSourcePath"));
|
||||
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
|
||||
CFCString::FileSystemRepresentation(cf_str, DBGSourcePath);
|
||||
}
|
||||
|
||||
if (!DBGBuildSourcePath.empty() && !DBGSourcePath.empty()) {
|
||||
if (DBGSourcePath[0] == '~') {
|
||||
FileSpec resolved_source_path(DBGSourcePath.c_str(), true);
|
||||
DBGSourcePath = resolved_source_path.GetPath();
|
||||
}
|
||||
module_spec.GetSourceMappingList().Append(
|
||||
ConstString(DBGBuildSourcePath.c_str()),
|
||||
ConstString(DBGSourcePath.c_str()), true);
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -179,21 +179,6 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
|
|||
std::string DBGBuildSourcePath;
|
||||
std::string DBGSourcePath;
|
||||
|
||||
plist.GetValueAsString("DBGBuildSourcePath",
|
||||
DBGBuildSourcePath);
|
||||
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);
|
||||
}
|
||||
|
||||
// DBGSourcePathRemapping is a dictionary in the plist
|
||||
// with
|
||||
// keys which are DBGBuildSourcePath file paths and
|
||||
|
@ -287,6 +272,24 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
|
|||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
// If we have a DBGBuildSourcePath + DBGSourcePath pair,
|
||||
// append those to the source path remappings.
|
||||
|
||||
plist.GetValueAsString("DBGBuildSourcePath",
|
||||
DBGBuildSourcePath);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue