Move language-specific debugging docs to the page for each language (#33692)
Release Notes: - N/A
This commit is contained in:
@@ -4,6 +4,7 @@ C support is available natively in Zed.
|
||||
|
||||
- Tree-sitter: [tree-sitter/tree-sitter-c](https://github.com/tree-sitter/tree-sitter-c)
|
||||
- Language Server: [clangd/clangd](https://github.com/clangd/clangd)
|
||||
- Debug Adapter: [CodeLLDB](https://github.com/vadimcn) (primary), [GDB](https://sourceware.org/gdb/) (secondary, not available on Apple silicon)
|
||||
|
||||
## Clangd: Force detect as C
|
||||
|
||||
@@ -61,3 +62,25 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
```
|
||||
|
||||
After building your project, CMake will generate the `compile_commands.json` file in the build directory and clangd will automatically pick it up.
|
||||
|
||||
## Debugging
|
||||
|
||||
You can use CodeLLDB or GDB to debug native binaries. (Make sure that your build process passes `-g` to the C compiler, so that debug information is included in the resulting binary.) See below for examples of debug configurations that you can add to `.zed/debug.json`.
|
||||
|
||||
### Build and Debug Binary
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"label": "Debug native binary",
|
||||
"build": {
|
||||
"command": "make",
|
||||
"args": ["-j8"],
|
||||
"cwd": "$ZED_WORKTREE_ROOT"
|
||||
}
|
||||
"program": "$ZED_WORKTREE_ROOT/build/prog",
|
||||
"request": "launch",
|
||||
"adapter": "CodeLLDB"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user