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

source

pub fn new(dsym_uuid: DebugId, original_uuid: DebugId) -> Self

Creates a new UUID mapping from two DebugIds.

source

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(),
)
source

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(),
)
source

pub fn original_uuid(&self) -> DebugId

Returns the UUID of the original object file.

source

pub fn dsym_uuid(&self) -> DebugId

Returns the UUID of the compiled binary and associated dSYM.

Trait Implementations§

source§

impl Clone for UuidMapping

source§

fn clone(&self) -> UuidMapping

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UuidMapping

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for UuidMapping

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<I, T> ExtractContext<I, ()> for T

source§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<I> RecreateContext<I> for I

source§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.