> -  expanded_location s = expand_location (BLOCK_SOURCE_LOCATION (stmt));
> +  location_t locus = BLOCK_SOURCE_LOCATION (stmt);
> +  expanded_location s = expand_location (locus);
>
>    if (dwarf_version >= 3 || !dwarf_strict)
>      {
>        add_AT_file (die, DW_AT_call_file, lookup_filename (s.file));
>        add_AT_unsigned (die, DW_AT_call_line, s.line);
> +      unsigned discr = get_discriminator_from_locus (locus);
> +      if (discr != 0)
> + add_AT_unsigned (die, DW_AT_discr, discr);

DW_AT_discr is used to identify the "discriminant" for variant
records; we should not reuse it for the discriminator, even if it's
the case that the other meaning could never apply to a
DW_TAG_inlined_subroutine. You should instead add a new
DW_AT_GNU_discriminator to include/dwarf2.def and use that. 0x2136
looks like the next value in the GNU vendor range. Note that
dwarf2.def lives in both GCC and binutils repos, so once you have
approval to commit to the GCC repo, you'll need to commit the same
change to the binutils repo as well.

-cary

Reply via email to