Extract Symbols From Non-Shared Cache Directory.

This commit is contained in:
Thomas A 2022-07-23 18:26:35 -07:00
parent 0dc5435bc3
commit fab0b9bd69
2 changed files with 16 additions and 6 deletions

View File

@ -5,13 +5,13 @@ use crate::location::ResultsLocation;
pub struct Cleanup {}
impl Cleanup {
pub fn preclean(results_locations: &ResultsLocation) {
pub fn remove_saved_symbols(results_locations: &ResultsLocation) {
if let Ok(_) = remove_dir_all(&results_locations.unique_version_path) {
println!("Deleted {:?}", results_locations.unique_version_path);
}
}
pub fn postclean(results_locations: &ResultsLocation) {
pub fn remove_temp(results_locations: &ResultsLocation) {
if let Ok(_) = remove_dir_all(&results_locations.temp_path) {
println!("Cleaned up temp data");
}

View File

@ -4,6 +4,8 @@ mod location;
mod program;
mod symbols;
use std::path::Path;
fn main() {
let arguments = argument::Arguments::new(std::env::args());
let base_locations = location::BaseLocation::new(&arguments);
@ -11,17 +13,25 @@ fn main() {
let system_version = program::SystemVersionDefaults::new(base_locations.system_version_path.to_str().unwrap());
let results_location = location::ResultsLocation::new(&arguments, &system_version);
clean::Cleanup::preclean(&results_location);
clean::Cleanup::remove_saved_symbols(&results_location);
let dyld_shared_cache_extractor = program::DyldSharedCacheExtractor::new(&base_locations, &results_location);
for path in dyld_shared_cache_extractor.extracted_paths.iter() {
let pase_filesystem_symbols = symbols::ParseBaseFilesystem::new(path);
let parse_filesystem_symbols = symbols::ParseBaseFilesystem::new(path);
let shared_cache_folder = path.file_name().expect("Unable to obtain shared cache folder name").to_str();
pase_filesystem_symbols.traverse(&results_location.shared_cache_path, shared_cache_folder, path);
parse_filesystem_symbols.traverse(&results_location.shared_cache_path, shared_cache_folder, path);
}
clean::Cleanup::postclean(&results_location);
clean::Cleanup::remove_temp(&results_location);
{
let path = Path::new(arguments.base_path.as_str());
let parse_filesystem_symbols = symbols::ParseBaseFilesystem::new(path);
parse_filesystem_symbols.traverse(&results_location.unique_version_path, Some("standard"), path);
}
clean::Cleanup::remove_temp(&results_location);
println!{"{:#?}",arguments}
println!{"{:#?}",system_version}