DWARF64 gcc/clang flag discussion

Mark Wielaard mark@klomp.org
Mon Nov 30 20:25:50 GMT 2020

On Mon, Nov 30, 2020 at 07:35:36PM +0000, Alexander Yermolovich via Gcc wrote:
> I guess discussion is from perspective of having both flags
> gdwarf32/gdwarf64. In which case it's a valid question on whether
> they should imply -g like -gdwarf-#.  But can this be viewed as only
> a -gdwarf64 flag, that is a qualifier to other debug flags that
> enable debug information? DWARF spec says that 32bit should be a
> default, and 64bit should be used rarely (paraphrasing). So when
> user enabled debug information the default expectation is that it
> will be 32bit. There is no real need for a flag to say "I want debug
> information, and I want it 32bit". On the other hand, 64bit DWARF
> format must be enabled. So from users perspective it's "I want debug
> information enabled for particular DWARF version and level, oh and I
> want it to be 64bit".

GCC already support DWARF64 because some gcc architectures already
default to DWARF64. They #define DWARF_OFFSET_SIZE PTR_SIZE. We
currently don't have an option to use DWARF32 for those
arches. -gdwarf32 would be that flag.

And in general I think you want composable command line flags where a
later flag can override an earlier flag.



More information about the Gcc mailing list