MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / active_local_cache

Function active_local_cache

plugins/pdb-ng/src/lib.rs:88–120  ·  view source on GitHub ↗
(view: Option<&BinaryView>)

Source from the content-addressed store, hash-verified

86}
87
88fn active_local_cache(view: Option<&BinaryView>) -> Result<String> {
89 // Check the local symbol store
90 let mut settings_query_options = view.map(QueryOptions::new_with_view).unwrap_or_default();
91 let settings = Settings::new();
92 let mut local_store_path = settings
93 .get_string_with_opts("pdb.files.localStoreAbsolute", &mut settings_query_options)
94 .to_string();
95 if local_store_path.is_empty() {
96 let relative_local_store = settings
97 .get_string_with_opts("pdb.files.localStoreRelative", &mut settings_query_options)
98 .to_string();
99 local_store_path = user_directory()
100 .join(relative_local_store)
101 .to_string_lossy()
102 .to_string();
103 }
104 if !local_store_path.is_empty() {
105 Ok(local_store_path)
106 } else if let Ok(default_cache) = default_local_cache() {
107 Ok(default_cache)
108 } else if let Ok(current) = current_dir().map(|d| {
109 d.to_str()
110 .expect("Expected current dir to be a valid string")
111 .to_string()
112 }) {
113 Ok(current)
114 } else {
115 Ok(temp_dir()
116 .to_str()
117 .expect("Expected temp dir to be a valid string")
118 .to_string())
119 }
120}
121
122fn parse_sym_srv(symbol_path: &str, default_store: String) -> Result<impl Iterator<Item = String>> {
123 // https://docs.microsoft.com/en-us/windows/win32/debug/using-symsrv

Callers 2

load_from_fileMethod · 0.85
parse_infoMethod · 0.85

Calls 6

default_local_cacheFunction · 0.85
mapMethod · 0.80
get_string_with_optsMethod · 0.80
joinMethod · 0.80
user_directoryFunction · 0.50
is_emptyMethod · 0.45

Tested by

no test coverage detected