Auto-detect Rust for CodeLLDB panic breakpoints#48236
Merged
Anthony-Eid merged 2 commits intozed-industries:mainfrom Feb 4, 2026
Merged
Auto-detect Rust for CodeLLDB panic breakpoints#48236Anthony-Eid merged 2 commits intozed-industries:mainfrom
Anthony-Eid merged 2 commits intozed-industries:mainfrom
Conversation
Fixes zed-industries#48231 When debugging Rust programs with CodeLLDB, panic breakpoints require `sourceLanguages: ["rust"]` to be set. Without this, CodeLLDB doesn't return the `rust_panic` exception filter, so the "Rust: on panic" breakpoint never resolves. The Cargo locator already sets this correctly, but other code paths (VSCode launch.json imports, manual configs) may not include it. This fix auto-detects Rust binaries by checking if the program path contains `/target/debug/` or `/target/release/` (Cargo's output dirs). If detected and `sourceLanguages` isn't already set, we add it automatically. Release Notes: - Fixed Rust panic breakpoints not working in debugger when using CodeLLDB with non-Cargo debug configurations
osiewicz
approved these changes
Feb 4, 2026
Member
osiewicz
left a comment
There was a problem hiding this comment.
Seems fine to me. I have a vague recollection that CodeLLDB does not like having superfluous sourceLanguages set (we started out with sourceLanguages: [cpp, rust] for sure), but since this can be opted out of by just setting the languages explicitly it should be ok.
adb-sh
pushed a commit
to adb-sh/zed
that referenced
this pull request
Feb 5, 2026
Fixes zed-industries#48231 ## Problem When debugging Rust programs with CodeLLDB, panic breakpoints ("Rust: on panic") don't work unless `sourceLanguages: ["rust"]` is explicitly set in the debug configuration. Without this setting, CodeLLDB doesn't return the `rust_panic` exception filter, so the breakpoint shows `locations = 0 (pending)` and never triggers. ## Root Cause The Cargo locator correctly adds `sourceLanguages: ["rust"]` ([cargo.rs:97-100](https://github.com/zed-industries/zed/blob/main/crates/project/src/debugger/locators/cargo.rs#L97-L100)), but other code paths may not: - VSCode launch.json imports - Manual debug configurations ## Solution Auto-detect Rust binaries in `CodeLldbDebugAdapter::get_binary()` by checking if the program path contains `/target/debug/` or `/target/release/` (Cargo's standard output directories). If detected and `sourceLanguages` isn't already set, we automatically add `["rust"]`. Release Notes: - Fixed Rust panic breakpoints not working in debugger when using CodeLLDB with non-Cargo debug configurations
rtfeldman
pushed a commit
that referenced
this pull request
Feb 5, 2026
Fixes #48231 ## Problem When debugging Rust programs with CodeLLDB, panic breakpoints ("Rust: on panic") don't work unless `sourceLanguages: ["rust"]` is explicitly set in the debug configuration. Without this setting, CodeLLDB doesn't return the `rust_panic` exception filter, so the breakpoint shows `locations = 0 (pending)` and never triggers. ## Root Cause The Cargo locator correctly adds `sourceLanguages: ["rust"]` ([cargo.rs:97-100](https://github.com/zed-industries/zed/blob/main/crates/project/src/debugger/locators/cargo.rs#L97-L100)), but other code paths may not: - VSCode launch.json imports - Manual debug configurations ## Solution Auto-detect Rust binaries in `CodeLldbDebugAdapter::get_binary()` by checking if the program path contains `/target/debug/` or `/target/release/` (Cargo's standard output directories). If detected and `sourceLanguages` isn't already set, we automatically add `["rust"]`. Release Notes: - Fixed Rust panic breakpoints not working in debugger when using CodeLLDB with non-Cargo debug configurations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #48231
Problem
When debugging Rust programs with CodeLLDB, panic breakpoints ("Rust: on panic") don't work unless
sourceLanguages: ["rust"]is explicitly set in the debug configuration.Without this setting, CodeLLDB doesn't return the
rust_panicexception filter, so the breakpoint showslocations = 0 (pending)and never triggers.Root Cause
The Cargo locator correctly adds
sourceLanguages: ["rust"](cargo.rs:97-100), but other code paths may not:Solution
Auto-detect Rust binaries in
CodeLldbDebugAdapter::get_binary()by checking if the program path contains/target/debug/or/target/release/(Cargo's standard output directories).If detected and
sourceLanguagesisn't already set, we automatically add["rust"].Release Notes: