This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] PR debug/38757 continued. Handle C11, C++11 and C++14.


On Thu, Nov 20, 2014 at 11:30:12PM +0100, Mark Wielaard wrote:
> @@ -19592,13 +19597,28 @@ gen_compile_unit_die (const char *filename)
>  
>    language = DW_LANG_C;
>    if (strncmp (language_string, "GNU C++", 7) == 0)
> -    language = DW_LANG_C_plus_plus;
> +    {
> +      language = DW_LANG_C_plus_plus;
> +      if (dwarf_version >= 5 || !dwarf_strict)
> +	{
> +	  if (strcmp (language_string, "GNU C++11") == 0)
> +	    language = DW_LANG_C_plus_plus_11;
> +	  else if (strcmp (language_string, "GNU C++14") == 0)
> +	    language = DW_LANG_C_plus_plus_14;
> +	}
> +    }

I think best would be to tweak
      if (value < 2 || value > 4)
        error_at (loc, "dwarf version %d is not supported", value);
      else
        opts->x_dwarf_version = value;
so that we accept value 5 too, and for now, until the
most common consumers are changed, use
  if (dwarf_version >= 5 /* || !dwarf_strict */)
so that
- you can actually use it in the test with -gdwarf-5
- you can commit it right away
- people can start playing with what it will mean to support DWARF5

GCC 4.5 also allowed -gdwarf-4 even when DWARF4 has not been released yet.
When there are consumers that can grok it, we can uncomment the
|| !dwarf_strict.

Jason, do you agree?

>    else if (strncmp (language_string, "GNU C", 5) == 0)
>      {
>        language = DW_LANG_C89;
>        if (dwarf_version >= 3 || !dwarf_strict)
> -	if (strcmp (language_string, "GNU C99") == 0)
> -	  language = DW_LANG_C99;
> +	{
> +	  if (strcmp (language_string, "GNU C89") != 0)
> +	    language = DW_LANG_C99;
> +
> +	  if (dwarf_version >= 5 || !dwarf_strict)
> +	    if (strcmp (language_string, "GNU C11") == 0)
> +	      language = DW_LANG_C11;
> +	}

Shouldn't we emit at least DW_LANG_C99 for GNU C11 if
not dwarf_version >= 5 /* || !dwarf_strict */ but
dwarf_version >= 3 || !dwarf_strict is true?

BTW, noticed we don't have anything for Fortran 2003 and 2008,
filed a DWARF Issue for that.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]