Bug 1808982 - Add the macOS 13 dyld shared cache path. r=canaltinova

This makes symbolication work on macOS 13+ for system libraries for which the Mozilla symbol server has no symbols,
for example for system libraries from macOS Beta versions.

It also makes the /asm/v1 endpoint work for system libraries on macOS 13+.

The dyld shared cache moved to a new location in that version.

This fix matches the fix for samply in da71321c59 .

Depends on D166227

Differential Revision: https://phabricator.services.mozilla.com/D166228
This commit is contained in:
Markus Stange 2023-01-11 22:00:51 +00:00
Родитель 833a2b3b5e
Коммит 5ad25cd2bd
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -122,6 +122,12 @@ class FileAndPathHelper {
// system-wide cache file and not present as individual files. // system-wide cache file and not present as individual files.
if (arch && (path.startsWith("/usr/") || path.startsWith("/System/"))) { if (arch && (path.startsWith("/usr/") || path.startsWith("/System/"))) {
// Use the special syntax `dyldcache:<dyldcachepath>:<librarypath>`. // Use the special syntax `dyldcache:<dyldcachepath>:<librarypath>`.
// Dyld cache location used on macOS 13+:
candidatePaths.push(
`dyldcache:/System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_${arch}:${path}`
);
// Dyld cache location used on macOS 11 and 12:
candidatePaths.push( candidatePaths.push(
`dyldcache:/System/Library/dyld/dyld_shared_cache_${arch}:${path}` `dyldcache:/System/Library/dyld/dyld_shared_cache_${arch}:${path}`
); );
@ -181,6 +187,12 @@ class FileAndPathHelper {
// system-wide cache file and not present as individual files. // system-wide cache file and not present as individual files.
if (arch && (path.startsWith("/usr/") || path.startsWith("/System/"))) { if (arch && (path.startsWith("/usr/") || path.startsWith("/System/"))) {
// Use the special syntax `dyldcache:<dyldcachepath>:<librarypath>`. // Use the special syntax `dyldcache:<dyldcachepath>:<librarypath>`.
// Dyld cache location used on macOS 13+:
candidatePaths.push(
`dyldcache:/System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/dyld_shared_cache_${arch}:${path}`
);
// Dyld cache location used on macOS 11 and 12:
candidatePaths.push( candidatePaths.push(
`dyldcache:/System/Library/dyld/dyld_shared_cache_${arch}:${path}` `dyldcache:/System/Library/dyld/dyld_shared_cache_${arch}:${path}`
); );