(view: Option<&BinaryView>)
| 86 | } |
| 87 | |
| 88 | fn 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 | |
| 122 | fn 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 |
no test coverage detected