zig icon indicating copy to clipboard operation
zig copied to clipboard

Zig can no longer debug C files compiled in

Open bpeake13 opened this issue 3 years ago • 5 comments

Zig Version

0.10.0-dev.4341+e4e1c21e1

Steps to Reproduce

Have a program that calls a native C function that was built with the zig application using addCSource. Attach a debug and try to step into the C function. The debugger will say there is no source available for the C functions.

This was produced on windows, using the VSCode cpp debugging.

Expected Behavior

When in debug builds C source should be debugable along with the zig source

Actual Behavior

C debug info appears ommited.

bpeake13 avatar Oct 17 '22 05:10 bpeake13

NOTE: Manually adding -g and -O0 to the c compilation fixes the issue.

bpeake13 avatar Oct 17 '22 05:10 bpeake13

Cannot reproduce on Linux.

Vexu avatar Oct 17 '22 10:10 Vexu

Should maybe note I'm using stage1, that might cause a difference

bpeake13 avatar Oct 17 '22 19:10 bpeake13

Stage1 also works as expected on Linux.

Vexu avatar Oct 18 '22 08:10 Vexu

This may be Windows specific issue - I can see this problem on Windows 11 with stage3.

michal-z avatar Oct 19 '22 22:10 michal-z

This was resolved by https://github.com/ziglang/zig/pull/15354

kcbanner avatar Oct 01 '23 22:10 kcbanner