I'm working on a dynamic analysis tool that needs runtime reflection in
C++. Since C++ has no standardized runtime reflection, I'm using DWARF as a
source of reflection metadata.
Is it a legitimate use-case from DWARF standard point of view?
It has been working great for me until I've upgraded to latest g++ and
clang compilers. Those compilers produce ambiguous names for some template
instantiations, so my tools no longer work. So I start to wonder: whether
it me misusing DWARF, or it is compilers that are buggy.
In particular, what is the DWARF answer for these questions:
1. Does DWARF guarantees that:
typeid(T1) == typeid(T2) ==> DW_AT_name(T1) == DW_AT_name(T2)
typeid(T1) != typeid(T2) ==> DW_AT_name(T1) != DW_AT_name(T2)
i.e. Is DW_AT_name an unique identifier for type?
2. Does DWARF guarantees that DW_AT_name(T) is a valid source language
i.e. If I copy string from DW_AT_name to source code, and compile it with
the same compiler that produced DWARF, will it produce the same type?
typeid(var1) == typeid (var2) ?
Dwarf-Discuss mailing list