Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Improve panic logging
Conrad Irwin345b983c8edd
diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rsindex ce395490164..6924b955f80 100644--- a/crates/zed/src/main.rs+++ b/crates/zed/src/main.rs@@ -542,7 +542,22 @@ fn init_panic_hook(app: &App, installation_id: Option<String>, session_id: Strinlet mut backtrace = backtrace.frames().iter()- .filter_map(|frame| Some(format!("{:#}", frame.symbols().first()?.name()?)))+ .flat_map(|frame| {+ frame.symbols().iter().filter_map(|symbol| {+ let name = symbol.name()?;+ let addr = symbol.addr()? as usize;+ let position = if let (Some(path), Some(lineno)) = (+ symbol.filename().and_then(|path| path.file_name()),+ symbol.lineno(),+ ) {+ format!("{}:{}", path.to_string_lossy(), lineno)+ } else {+ "?".to_string()+ };++ Some(format!("{:} ({:#x}) at {}", name, addr, position))+ })+ }).collect::<Vec<_>>();// Strip out leading stack frames for rust panic-handling.