FileAndPathHelper

Trait FileAndPathHelper 

Source
pub trait FileAndPathHelper {
    type F: FileContents + 'static;
    type FL: FileLocation + 'static;

    // Required methods
    fn get_candidate_paths_for_debug_file(
        &self,
        info: &LibraryInfo,
    ) -> FileAndPathHelperResult<Vec<CandidatePathInfo<Self::FL>>>;
    fn get_candidate_paths_for_binary(
        &self,
        info: &LibraryInfo,
    ) -> FileAndPathHelperResult<Vec<CandidatePathInfo<Self::FL>>>;
    fn get_dyld_shared_cache_paths(
        &self,
        arch: Option<&str>,
    ) -> FileAndPathHelperResult<Vec<Self::FL>>;
    fn load_file(
        &self,
        location: Self::FL,
    ) -> Pin<Box<dyn OptionallySendFuture<Output = FileAndPathHelperResult<Self::F>> + '_>>;

    // Provided methods
    fn get_candidate_paths_for_gnu_debug_link_dest(
        &self,
        _original_file_location: &Self::FL,
        _debug_link_name: &str,
    ) -> FileAndPathHelperResult<Vec<Self::FL>> { ... }
    fn get_candidate_paths_for_supplementary_debug_file(
        &self,
        _original_file_path: &Self::FL,
        _supplementary_file_path: &str,
        _supplementary_file_build_id: &ElfBuildId,
    ) -> FileAndPathHelperResult<Vec<Self::FL>> { ... }
    fn get_symbol_map_for_library(
        &self,
        _info: &LibraryInfo,
    ) -> Option<(Self::FL, Arc<dyn SymbolMapTrait + Send + Sync>)> { ... }
}
Expand description

This is the trait that consumers need to implement so that they can call the main entry points of this crate. This crate contains no direct file access - all access to the file system is via this trait, and its associated trait FileContents.

Required Associated Types§

Source

type F: FileContents + 'static

Source

type FL: FileLocation + 'static

Required Methods§

Source

fn get_candidate_paths_for_debug_file( &self, info: &LibraryInfo, ) -> FileAndPathHelperResult<Vec<CandidatePathInfo<Self::FL>>>

Given a “debug name” and a “breakpad ID”, return a list of file paths which may potentially have artifacts containing symbol data for the requested binary (executable or library).

The symbolication methods will try these paths one by one, calling load_file for each until it succeeds and finds a file whose contents match the breakpad ID. Any remaining paths are discarded.

§Arguments
  • debug_name: On Windows, this is the filename of the associated PDB file of the executable / DLL, for example “firefox.pdb” or “xul.pdb”. On non-Windows, this is the filename of the binary, for example “firefox” or “XUL” or “libxul.so”.
  • breakpad_id: A string of 33 hex digits, serving as a hash of the contents of the binary / library. On Windows, this is 32 digits “signature” plus one digit of “pdbAge”. On non-Windows, this is the binary’s UUID (ELF id or mach-o UUID) plus a “0” digit at the end (replacing the pdbAge).
Source

fn get_candidate_paths_for_binary( &self, info: &LibraryInfo, ) -> FileAndPathHelperResult<Vec<CandidatePathInfo<Self::FL>>>

TODO

Source

fn get_dyld_shared_cache_paths( &self, arch: Option<&str>, ) -> FileAndPathHelperResult<Vec<Self::FL>>

TODO

Source

fn load_file( &self, location: Self::FL, ) -> Pin<Box<dyn OptionallySendFuture<Output = FileAndPathHelperResult<Self::F>> + '_>>

This method is the entry point for file access during symbolication. The implementer needs to return an object which implements the FileContents trait. This method is asynchronous, but once it returns, the file data needs to be available synchronously because the FileContents methods are synchronous. If there is no file at the requested path, an error should be returned (or in any other error case).

Provided Methods§

TODO

Source

fn get_candidate_paths_for_supplementary_debug_file( &self, _original_file_path: &Self::FL, _supplementary_file_path: &str, _supplementary_file_build_id: &ElfBuildId, ) -> FileAndPathHelperResult<Vec<Self::FL>>

TODO

Source

fn get_symbol_map_for_library( &self, _info: &LibraryInfo, ) -> Option<(Self::FL, Arc<dyn SymbolMapTrait + Send + Sync>)>

Ask the helper to return a SymbolMap if it happens to have one available already.

Implementors§