[Dwarf-Discuss] Best practices for implementing new features?

Robinson, Paul Paul_Robinson@playstation.sony.com
Tue Mar 10 18:31:53 GMT 2015

> My first intuition would be to still use DW_TAG_imported_module according
> to the DWARF standard (DWARF is supposed to describe concepts, not
> specific language features); but there is a risk of confusing existing
> debuggers that expect exactly an imported C++ namespace inside a
> DW_TAG_imported_module.

DWARF already says that DW_TAG_imported_module/DW_AT_import can refer to a
DW_TAG_module, as well as a namespace.  If Clang is using DW_TAG_module to
describe a C++ module, I think that's totally reasonable.

I don't know the state of gcc/gdb support for Fortran, but Fortran 90 has
modules (says so right there in the DWARF spec) so I'd hope that gdb would
already be willing to accept an import of a DW_TAG_module.

My impression is that Clang now uses compile_unit or partial_unit to
describe modules? which is a bit of a stretch, and it would be safer to
use DW_TAG_module.

> The safe solution would be to emit a vendor-specific
> DW_TAG_LLVM_imported_module for now and then later (e.g., when modules are
> an official part of C++1z?) bring this up before the committee.

Well, that would guarantee that no debugger would make use of the modules
unless you specifically taught them to do so. That is possibly "safe" but
somehow doesn't seem particularly useful.

More information about the Dwarf-discuss mailing list