/// Download debug symbols and apply them to a libc
Download debug symbols and apply them to a libc
Download debug symbols and apply them to a libc
fn do_unstrip_libc(libc: &Path, ver: &LibcVersion) -> Result {
    println!("{}", "unstripping libc".yellow().bold());
    let deb_file_name = format!("libc6-dbg_{}.deb", ver);
    let tmp_dir = TempDir::new().context(TmpDirSnafu)?;
    let sym_path = tmp_dir.path().join("libc-syms");
    let name = format!("libc-{}.so", ver.string_short);
    libc_deb::write_ubuntu_pkg_file(&deb_file_name, &name, &sym_path).context(DebSnafu)?;
    let out = Command::new("eu-unstrip")
        .arg(libc)
        .arg(&sym_path)
        .output()
        .context(CmdRunSnafu)?;
    let _ = stderr().write_all(&out.stderr);
    let _ = stdout().write_all(&out.stdout);
    if !out.status.success() {
        return Err(Error::CmdFail { status: out.status });
    }
    let mut sym_file = File::open(sym_path).context(SymOpenSnafu)?;
    let mut libc_file = File::create(libc).context(LibcOpenSnafu)?;
    copy(&mut sym_file, &mut libc_file).context(LibcWriteSnafu)?;
    Ok(())
}
fn do_unstrip_libc ( libc : & Path , ver : & LibcVersion ) -> Result { println ! ( " " " " yellow ( ) bold ( ) ) ; let deb_file_name = format ! ( " " ver ) ; let tmp_dir = TempDir :: new ( ) . context ( TmpDirSnafu ) ? ; let sym_path = tmp_dir . path ( ) . join ( " " ) ; let name = format ! ( " " ver string_short ) ; libc_deb :: write_ubuntu_pkg_file ( & deb_file_name , & name , & sym_path ) . context ( DebSnafu ) ? ; let out = Command :: new ( " " ) . arg ( libc ) . arg ( & sym_path ) . output ( ) . context ( CmdRunSnafu ) ? ; let _ = stderr ( ) . write_all ( & out . stderr ) ; let _ = stdout ( ) . write_all ( & out . stdout ) ; if ! out . status . success ( ) { return Err ( Error :: CmdFail { status : out . status } ) ; } let mut sym_file = File :: open ( sym_path ) . context ( SymOpenSnafu ) ? ; let mut libc_file = File :: create ( libc ) . context ( LibcOpenSnafu ) ? ; copy ( & mut sym_file , & mut libc_file ) . context ( LibcWriteSnafu ) ? ; Ok ( ( ) ) }
Download debug symbols and apply them to a libc
Download debug symbols and apply them to a libc
libc
&Path
ver
&LibcVersion