aya: uprobe: use PathBuf for ResolveSymbolError::DebuglinkAccessError

Makes no sense to use a string, as it's a path.
This breaks the public API.
reviewable/pr1264/r8
Omri Steiner 2 weeks ago committed by Tamir Duberstein
parent 90d5604877
commit 33c9f2b2b2

@ -621,7 +621,7 @@ enum ResolveSymbolError {
SectionFileRangeNone(String, Result<String, object::Error>), SectionFileRangeNone(String, Result<String, object::Error>),
#[error("failed to access debuglink file `{0}`: `{1}`")] #[error("failed to access debuglink file `{0}`: `{1}`")]
DebuglinkAccessError(String, io::Error), DebuglinkAccessError(PathBuf, io::Error),
#[error("symbol `{0}` not found, mismatched build IDs in main and debug files")] #[error("symbol `{0}` not found, mismatched build IDs in main and debug files")]
BuildIdMismatch(String), BuildIdMismatch(String),
@ -695,15 +695,8 @@ fn resolve_symbol(path: &Path, symbol: &str) -> Result<u64, ResolveSymbolError>
} else { } else {
// Only search in the debug object if the symbol was not found in the main object // Only search in the debug object if the symbol was not found in the main object
let debug_path = find_debug_path_in_object(&obj, path, symbol)?; let debug_path = find_debug_path_in_object(&obj, path, symbol)?;
let debug_data = MMap::map_copy_read_only(&debug_path).map_err(|e| { let debug_data = MMap::map_copy_read_only(&debug_path)
ResolveSymbolError::DebuglinkAccessError( .map_err(|e| ResolveSymbolError::DebuglinkAccessError(debug_path, e))?;
debug_path
.to_str()
.unwrap_or("Debuglink path missing")
.to_string(),
e,
)
})?;
let debug_obj = object::read::File::parse(debug_data.as_ref())?; let debug_obj = object::read::File::parse(debug_data.as_ref())?;
verify_build_ids(&obj, &debug_obj, symbol)?; verify_build_ids(&obj, &debug_obj, symbol)?;

Loading…
Cancel
Save