Hi Richard,
I’m not sure using platform native AND the term DWARF would help rather than add to confusion. Let me still try to
help a bit with context here.
For Linux and most BSDs, we have settled on the Executable and Linking Format (ELF) as the container format for
your machine code. And you might see where the inspiration for DWARF might come from.
For macOS, we have mach object (mach-o) as the container format. Its distinctly different to ELF, and also the
reason why Linux/BSD and macOS are sometimes substantially different, wrt to executable packaging and linking.
For windows we have Portable Executable (PE) as the container format.
My recollection is that we implemented DWARF in the NCG only for ELF. I've always wanted to scratch an itch
and try to make it work for mach-o as well, but never got around to it (yet?). The NCGs have flags that specify
if we want to emit debug info or not. I believe most codegens except for x86_64/elf ignore that flag.
This is a non-trivial engineering effort to get done properly, I believe. And we all spend time on many other things.
Depending on how familiar you are with development on macOS, you might know the notion of dSYM folders,
where macOS usually separate the application binary into the binary, and then stores the (d)ebug (SYM)bols in
a separate folder. Those are iirc DWARF objects in the end.
Hope this helps a bit; my recollection might be a bit rusty.
Best,
Moritz