Zig debugging in Zed - Is it documented?

Hello All!
This is my first post on the Zig forum, so please forgive me if I’ve chosen the wrong topic to post on. Anyway, I was trying to get Zig debugging working with Zed. Zed does not have debugging for Zig built-in (yet), so I went in search of an example. After a quite a lot of searching I hacked out the following Zed debug definition for use in the Zed debug.json:

 {
    "label": "Debug Zig binary",
    "build": {
      "command": "zig",
      "args": ["build"],
      "cwd": "$ZED_WORKTREE_ROOT",
    },
    "program": "$ZED_WORKTREE_ROOT/zig-out/bin/zig_scratch",
    "request": "launch",
    "adapter": "CodeLLDB",
  },

This works for me using Zed 1.7.2 and Zig 0.16.0. Is this documented anywhere? Can anybody improve on my definition? My aim is to get Zig supported by Zed out-of-the-box.

Cheers!!

Dermot

4 Likes

Idk if zed specifically is documented, but when using the LLVM backend, any low level debugger should work with zig.

However, when using the custom backends, you need a fork of LLDB to debug zig, though it provides a better experience.

1 Like