2 unstable releases

new 0.2.0 Feb 16, 2025
0.1.0 Feb 13, 2025

#508 in Encoding

Download history 241/week @ 2025-02-11

241 downloads per month

Apache-2.0

13KB
288 lines

Crates.io

Documentation | Example

resym

Serialize and symbolicate stack traces from remotely located PDB.

[dependencies]
resym = "0.1"

Here's an example:

// your application

fn set_panic_hook() {
  std::panic::set_hook(Box::new(move |info| {
    #[cfg(all(target_os = "windows", target_arch = "x86_64"))]
    {
      let trace_str = resym::win64::trace();
      println!("Visit to symbolicate: http://<resym_svc>/{}", trace_str);
    }
  }));
}

fn main() {
  set_panic_hook();

  panic!("oh no!");
}
// your symbolification service

// GET /<trace_str>
fn handle_request(mut trace_str: Vec<u8>) -> Result<String> {
  let mut writer = Vec::new();
  let stream = std::fs::File::open("example.pdb")?;

  resym::symbolicate(stream, &mut trace_str, resym::DefaultFormatter::new(&mut writer))?;

  Ok(String::from_utf8(writer)?)
}

image

Dependencies

~2MB
~44K SLoC