fn os_specific_try_to_find_pdb()

in src/windows/utils.rs [36:54]


fn os_specific_try_to_find_pdb(path: &Path, pdb_filename: &str) -> (Option<Vec<u8>>, String) {
    // We may have gotten either an OS native path, or a Windows path.
    // On Windows, they're both the same. On Unix, they are different, and in that case,
    // we change backslashes to forward slashes for `file_name()` to do its job.
    // But before that, just try wether the file exists.
    #[cfg(unix)]
    let pdb_filename = pdb_filename.replace('\\', "/");
    let pdb_path = Path::new(&pdb_filename);
    if let Some(file_name) = pdb_path.file_name() {
        let pdb_name = file_name.to_str().unwrap().to_string();
        if pdb_path.is_file() {
            (Some(utils::read_file(pdb_path)), pdb_name)
        } else {
            (try_to_find_pdb(path, &pdb_name), pdb_name)
        }
    } else {
        (None, "".to_string())
    }
}