FileLocation

Trait FileLocation 

Source
pub trait FileLocation: Clone + Display {
    // Required methods
    fn location_for_dyld_subcache(&self, suffix: &str) -> Option<Self>;
    fn location_for_external_object_file(
        &self,
        object_file: &str,
    ) -> Option<Self>;
    fn location_for_pdb_from_binary(
        &self,
        pdb_path_in_binary: &str,
    ) -> Option<Self>;
    fn location_for_source_file(&self, source_file_path: &str) -> Option<Self>;
    fn location_for_breakpad_symindex(&self) -> Option<Self>;
    fn location_for_dwo(&self, comp_dir: &str, path: &str) -> Option<Self>;
    fn location_for_dwp(&self) -> Option<Self>;
}
Expand description

A trait which abstracts away the token that’s passed to the FileAndPathHelper::load_file trait method.

This is usually something like a PathBuf, but it can also be more complicated. For example, in wholesym this is an enum which can refer to a local file or to a file from a symbol server.

Required Methods§

Source

fn location_for_dyld_subcache(&self, suffix: &str) -> Option<Self>

Called on a Dyld shared cache location to create a location for a subcache. Subcaches are separate files with filenames such as dyld_shared_cache_arm64e.01.

The suffix begins with a period.

Source

fn location_for_external_object_file(&self, object_file: &str) -> Option<Self>

Called on the location of a debug file in order to create a location for an external object file, based on an absolute path found in the “object map” of the original file.

Source

fn location_for_pdb_from_binary(&self, pdb_path_in_binary: &str) -> Option<Self>

Callod on the location of a PE binary in order to create a location for a corresponding PDB file, based on an absolute PDB path found in the binary.

Source

fn location_for_source_file(&self, source_file_path: &str) -> Option<Self>

Called on the location of a debug file in order to create a location for a source file. source_file_path is the path to the source file as written down in the debug file. This is usually an absolute path.

Only one case with a relative path has been observed to date: In this case the “debug file” was a synthetic .so file which was generated by perf inject --jit based on a JITDUMP file which included relative paths. You could argue that the application which emitted relative paths into the JITDUMP file was creating bad data and should have written out absolute paths. However, the perf infrastructure worked fine on this file, because the relative paths happened to be relative to the working directory, and because perf / objdump were resolving those relative paths relative to the current working directory.

Source

fn location_for_breakpad_symindex(&self) -> Option<Self>

Called on the location of a Breakpad sym file, to get a location for its corresponding symindex file.

Source

fn location_for_dwo(&self, comp_dir: &str, path: &str) -> Option<Self>

Source

fn location_for_dwp(&self) -> Option<Self>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§