this is surprising to me. zig defaults to a single compilation unit per binary, so the situation with the standard library should be the same as with your code. indeed, in LLDB i’m regularly able to step into standard library code as well as other zig dependencies and even C compiled in by the build system.
maybe GDB is having trouble matching symbols to source locations?
gdb) info sources
/tmp/aaa/bin/hello:
(Full debug information has not yet been read for this file.)
/opt/zig-x86_64-linux-0.16.0/lib/std/debug/no_panic.zig, /opt/zig-x86_64-linux-0.16.0/lib/std/std.zig, /opt/zig-x86_64-linux-0.16.0/lib/compiler_rt/count0bits.zig, /opt/zig-x86_64-linux-0.16.0/lib/compiler_rt.zig, /tmp/.cache/b/c08c31c8f7a39a3aaf2c053849413f07/builtin.zig, /opt/zig-x86_64-linux-0.16.0/lib/std/debug.zig, /tmp/.cache/b/732180f821dd8acbfb164c6928ad5abc/builtin.zig, /opt/zig-x86_64-linux-0.16.0/lib/ubsan_rt.zig, /tmp/hello/src/root.zig, /tmp/hello/src/main.zig
(gdb) b main.main
Breakpoint 1 at 0x11a9883: file main.zig, line 8.
(gdb) run
Starting program: /tmp/aaa/bin/hello
Breakpoint 1, main.main (init=...) at main.zig:8
8 std.debug.print("All your {s} are belong to us.\n", .{"codebase"});
(gdb) bt
#0 main.main (init=...) at main.zig:8
(gdb) step
All your codebase are belong to us.
11 const arena: std.mem.Allocator = init.arena.allocator();
(gdb) b std.debug.print
Function "std.debug.print" not defined.
I haven’t experienced this problem myself, but I think I’ve seen in other threads that the new non-llvm backend, which is used by default in default/debug mode, is not compatible with the debuggers. If you want to try it, you can add -fllvm when running build-exe and then trying debugging with lldb. I could be wrong.
Or to use zig build see this note in the other thread: