From e4f2492099cf76bc1eb1eda56eaf56ecf6fadbf8 Mon Sep 17 00:00:00 2001 From: cui Date: Sat, 14 Feb 2026 18:38:04 +0800 Subject: [PATCH] debugger: Fix panic at non-UTF-8 character in paths on Linux (#49103) Before you mark this PR as ready for review, make sure that you have: - [ ] Added a solid test coverage and/or screenshots from doing manual testing - [ ] Done a self-review taking into account security and performance aspects - [ ] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - N/A --- crates/project/src/debugger/breakpoint_store.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/project/src/debugger/breakpoint_store.rs b/crates/project/src/debugger/breakpoint_store.rs index 7da8a180887a6f8ee9107201b1ee2c2d650cce20..d548781891598b229c430692bee36919bf7669fb 100644 --- a/crates/project/src/debugger/breakpoint_store.rs +++ b/crates/project/src/debugger/breakpoint_store.rs @@ -316,7 +316,7 @@ impl BreakpointStore { for (path, breakpoint_set) in &self.breakpoints { let _ = client.send(proto::BreakpointsForFile { project_id: *project_id, - path: path.to_str().map(ToOwned::to_owned).unwrap(), + path: path.to_string_lossy().into_owned(), breakpoints: breakpoint_set .breakpoints .iter() @@ -553,7 +553,7 @@ impl BreakpointStore { { cx.background_spawn(remote.upstream_client.request(proto::ToggleBreakpoint { project_id: remote.upstream_project_id, - path: abs_path.to_str().map(ToOwned::to_owned).unwrap(), + path: abs_path.to_string_lossy().into_owned(), breakpoint: Some(breakpoint), })) .detach(); @@ -577,7 +577,7 @@ impl BreakpointStore { let _ = client.send(proto::BreakpointsForFile { project_id: *project_id, - path: abs_path.to_str().map(ToOwned::to_owned).unwrap(), + path: abs_path.to_string_lossy().into_owned(), breakpoints, }); }