diff --git a/crates/symbolicator-sources/src/paths.rs b/crates/symbolicator-sources/src/paths.rs index b98ebb6a9..8eee3b8a6 100644 --- a/crates/symbolicator-sources/src/paths.rs +++ b/crates/symbolicator-sources/src/paths.rs @@ -414,6 +414,12 @@ fn get_unified_path(filetype: FileType, identifier: &ObjectId) -> Option Some(format!("{}/{}/{}", id.get(..2)?, id.get(2..)?, suffix)) } +fn get_slashsymbols_path(identifier: &ObjectId) -> Option { + let code_id = identifier.code_id.as_ref()?; + let code_file = identifier.validated_code_file_basename()?; + Some(format!("{code_file}/{code_id}/symbols")) +} + /// Determines the paths for an object file in the given layout. /// /// The vector is ordered from lower priority to highest priority. @@ -439,12 +445,9 @@ pub fn get_directory_paths( DirectoryLayoutType::Unified => { get_unified_path(filetype, identifier).into_iter().collect() } - DirectoryLayoutType::SlashSymbols => identifier - .code_id - .as_ref() - .map(|code_id| format!("{}/symbols", code_id.as_str())) - .into_iter() - .collect(), + DirectoryLayoutType::SlashSymbols => { + get_slashsymbols_path(identifier).into_iter().collect() + } }; for path in paths.iter_mut() { @@ -744,7 +747,10 @@ mod tests { &ELF_OBJECT_ID, ); assert_eq!(paths.len(), 1); - assert_eq!(paths[0], "dfb85de42daffd09640c8fe377d572de3e168920/symbols"); + assert_eq!( + paths[0], + "libm-2.23.so/dfb85de42daffd09640c8fe377d572de3e168920/symbols" + ); } #[test]