Struct symbolic_debuginfo::macho::UuidMapping
source · pub struct UuidMapping { /* private fields */ }
Expand description
A mapping from the dSYM
UUID to an original UUID.
This is used e.g. when dealing with bitcode builds, when Apple compiles objects from
bitcode these objects will have new UUIDs as debug identifiers. This mapping can be
found in the dSYMs/<object-id>/Contents/Resources/<object-id>.plist
file of downloaded
debugging symbols.
This struct allows you to keep track of such a mapping and provides support for parsing it from the ProperyList file format.
Implementations§
source§impl UuidMapping
impl UuidMapping
sourcepub fn new(dsym_uuid: DebugId, original_uuid: DebugId) -> Self
pub fn new(dsym_uuid: DebugId, original_uuid: DebugId) -> Self
Creates a new UUID mapping from two DebugId
s.
sourcepub fn parse_plist(
dsym_uuid: DebugId,
data: &[u8]
) -> Result<Self, UuidMappingError>
pub fn parse_plist( dsym_uuid: DebugId, data: &[u8] ) -> Result<Self, UuidMappingError>
Parses a PropertyList containing a DBGOriginalUUID
mapping.
The filename
may contain multiple path segments, the stem of the filename segment
should contain the UUID of the dSYM
.
Examples
use std::path::Path;
use symbolic_common::DebugId;
use symbolic_debuginfo::macho::UuidMapping;
let filename = Path::new("2d10c42f-591d-3265-b147-78ba0868073f.plist");
let dsym_uuid: DebugId = filename
.file_stem().unwrap()
.to_str().unwrap()
.parse().unwrap();
let data = std::fs::read(filename).unwrap();
let uuid_map = UuidMapping::parse_plist(dsym_uuid, &data).unwrap();
assert_eq!(uuid_map.dsym_uuid(), dsym_uuid);
assert_eq!(
uuid_map.original_uuid(),
"c8374b6d-6e96-34d8-ae38-efaa5fec424f".parse().unwrap(),
)
sourcepub fn parse_plist_with_filename(
filename: &Path,
data: &[u8]
) -> Result<Self, UuidMappingError>
pub fn parse_plist_with_filename( filename: &Path, data: &[u8] ) -> Result<Self, UuidMappingError>
Parses a PropertyList containing a DBGOriginalUUID
mapping.
This is a convenience version of UuidMapping::parse_plist
which extracts
the UUID from the filename
.
The filename
may contain multiple path segments, the stem of the filename segment
should contain the UUID of the dSYM
. This is the format the PList is normally
found in a dSYM
directory structure.
Examples
use std::path::Path;
use symbolic_common::DebugId;
use symbolic_debuginfo::macho::UuidMapping;
let filename = Path::new("Contents/Resources/2D10C42F-591D-3265-B147-78BA0868073F.plist");
let data = std::fs::read(filename).unwrap();
let uuid_map = UuidMapping::parse_plist_with_filename(filename, &data).unwrap();
assert_eq!(
uuid_map.dsym_uuid(),
"2d10c42f-591d-3265-b147-78ba0868073f".parse().unwrap(),
);
assert_eq!(
uuid_map.original_uuid(),
"c8374b6d-6e96-34d8-ae38-efaa5fec424f".parse().unwrap(),
)
sourcepub fn original_uuid(&self) -> DebugId
pub fn original_uuid(&self) -> DebugId
Returns the UUID of the original object file.
Trait Implementations§
source§impl Clone for UuidMapping
impl Clone for UuidMapping
source§fn clone(&self) -> UuidMapping
fn clone(&self) -> UuidMapping
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more