r184276 - Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4

Eric Christopher echristo at gmail.com
Wed Jun 19 08:57:52 PDT 2013


Hi Manman,

Few issues with this patch:

> Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4
>
> These options will add a module flag with name "Dwarf Version".
> The behavior flag is currently set to Warning, so when two values disagree,
> a warning will be emitted.
>

I don't think a module flag is the way we want to go about this, I
think it should be an attribute on the compile unit created.

Few constraints there:

a) this means that we just check the compile unit as we create up the
DIE and we don't have to check the module.
b) at LTO time we can link and generate debug info for modules that
may (due to historic, or otherwise silly reasons) have used two
different values for dwarf level without a warning,
c) at LTO time we'll likely want to constrain to a minimum dwarf
version that contains ref addr so that we can minimize, but this is by
no means required,
d) it matches how linkers actually link debug information

Also:

> +  else if (Opts.getDebugInfo() != CodeGenOptions::NoDebugInfo)
> +    // Default Dwarf version is 3 if we are generating debug information.
> +    Opts.DwarfVersion = 3;
>

We want 4 here I believe, or even a level for "latest" with all of the
bells and whistles. 4 is a likely sufficient start though since we'd
have to define what "all the bells and whistles" means :) Or, as an
alternate question, "why 3?"

Thanks!

-eric



More information about the cfe-commits mailing list