gcc -g1 does not do what the docs say?
Thu Feb 13 15:48:00 GMT 2020
On Wed, 12 Feb 2020, Alexey Neyman wrote:
> Am I missing something? Or is it a bug in GCC?
The behavior differs for DWARF vs. older debug info formats. Try -gstabs -g1,
you'll see an annotation for the global variable in the assembly.
I would recommend to open an issue in the GCC Bugzilla, either to bring DWARF
generation in line with the promise of the documentation (if you need that),
or correct the documentation to explain what happens for DWARF.
More information about the Gcc-help