fn try_to_find_pdb()

in src/windows/utils.rs [14:33]


fn try_to_find_pdb(path: &Path, pdb_filename: &str) -> Option<Vec<u8>> {
    // Just check that the file is in the same directory as the PE one
    let pdb = path.with_file_name(pdb_filename);
    let pdb_cab = pdb.with_extension("pd_");

    for pdb in vec![pdb, pdb_cab].into_iter() {
        if pdb.is_file() {
            return Some(utils::read_file(pdb));
        }
    }

    // We try in CWD
    let mut pdb = std::env::current_dir().expect("Unable to get the current working directory");
    pdb.set_file_name(pdb_filename);
    if pdb.is_file() {
        Some(utils::read_file(pdb))
    } else {
        None
    }
}