Skip to content
This repository was archived by the owner on Apr 2, 2020. It is now read-only.

Commit ea45f01

Browse files
committed
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> git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@322418 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 4379340 commit ea45f01

File tree

2 files changed

+47
-37
lines changed

2 files changed

+47
-37
lines changed

source/Host/macosx/Symbols.cpp

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -333,28 +333,9 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
333333
std::string DBGBuildSourcePath;
334334
std::string DBGSourcePath;
335335

336-
cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
337-
CFSTR("DBGBuildSourcePath"));
338-
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
339-
CFCString::FileSystemRepresentation(cf_str, DBGBuildSourcePath);
340-
}
341-
342-
cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
343-
CFSTR("DBGSourcePath"));
344-
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
345-
CFCString::FileSystemRepresentation(cf_str, DBGSourcePath);
346-
}
347-
348-
if (!DBGBuildSourcePath.empty() && !DBGSourcePath.empty()) {
349-
if (DBGSourcePath[0] == '~') {
350-
FileSpec resolved_source_path(DBGSourcePath.c_str(), true);
351-
DBGSourcePath = resolved_source_path.GetPath();
352-
}
353-
module_spec.GetSourceMappingList().Append(
354-
ConstString(DBGBuildSourcePath.c_str()),
355-
ConstString(DBGSourcePath.c_str()), true);
356-
}
357-
336+
// If DBGVersion value 2 or higher, look for
337+
// DBGSourcePathRemapping dictionary and append the key-value pairs
338+
// to our remappings.
358339
cf_dict = (CFDictionaryRef)CFDictionaryGetValue(
359340
(CFDictionaryRef)uuid_dict, CFSTR("DBGSourcePathRemapping"));
360341
if (cf_dict && CFGetTypeID(cf_dict) == CFDictionaryGetTypeID()) {
@@ -439,6 +420,32 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
439420
free(values);
440421
}
441422
}
423+
424+
425+
// If we have a DBGBuildSourcePath + DBGSourcePath pair,
426+
// append them to the source remappings list.
427+
428+
cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
429+
CFSTR("DBGBuildSourcePath"));
430+
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
431+
CFCString::FileSystemRepresentation(cf_str, DBGBuildSourcePath);
432+
}
433+
434+
cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
435+
CFSTR("DBGSourcePath"));
436+
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
437+
CFCString::FileSystemRepresentation(cf_str, DBGSourcePath);
438+
}
439+
440+
if (!DBGBuildSourcePath.empty() && !DBGSourcePath.empty()) {
441+
if (DBGSourcePath[0] == '~') {
442+
FileSpec resolved_source_path(DBGSourcePath.c_str(), true);
443+
DBGSourcePath = resolved_source_path.GetPath();
444+
}
445+
module_spec.GetSourceMappingList().Append(
446+
ConstString(DBGBuildSourcePath.c_str()),
447+
ConstString(DBGSourcePath.c_str()), true);
448+
}
442449
}
443450
return success;
444451
}

source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -179,21 +179,6 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
179179
std::string DBGBuildSourcePath;
180180
std::string DBGSourcePath;
181181

182-
plist.GetValueAsString("DBGBuildSourcePath",
183-
DBGBuildSourcePath);
184-
plist.GetValueAsString("DBGSourcePath", DBGSourcePath);
185-
if (!DBGBuildSourcePath.empty() &&
186-
!DBGSourcePath.empty()) {
187-
if (DBGSourcePath[0] == '~') {
188-
FileSpec resolved_source_path(DBGSourcePath.c_str(),
189-
true);
190-
DBGSourcePath = resolved_source_path.GetPath();
191-
}
192-
module_sp->GetSourceMappingList().Append(
193-
ConstString(DBGBuildSourcePath),
194-
ConstString(DBGSourcePath), true);
195-
}
196-
197182
// DBGSourcePathRemapping is a dictionary in the plist
198183
// with
199184
// keys which are DBGBuildSourcePath file paths and
@@ -287,6 +272,24 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
287272
return true;
288273
});
289274
}
275+
276+
// If we have a DBGBuildSourcePath + DBGSourcePath pair,
277+
// append those to the source path remappings.
278+
279+
plist.GetValueAsString("DBGBuildSourcePath",
280+
DBGBuildSourcePath);
281+
plist.GetValueAsString("DBGSourcePath", DBGSourcePath);
282+
if (!DBGBuildSourcePath.empty() &&
283+
!DBGSourcePath.empty()) {
284+
if (DBGSourcePath[0] == '~') {
285+
FileSpec resolved_source_path(DBGSourcePath.c_str(),
286+
true);
287+
DBGSourcePath = resolved_source_path.GetPath();
288+
}
289+
module_sp->GetSourceMappingList().Append(
290+
ConstString(DBGBuildSourcePath),
291+
ConstString(DBGSourcePath), true);
292+
}
290293
}
291294
}
292295
}

0 commit comments

Comments
 (0)