r248792 - in /trunk/gcc: ChangeLog dwarf2out.c ...

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Thu Jun 1 14:06:00 GMT 2017


Author: pmderodat
Date: Thu Jun  1 14:06:37 2017
New Revision: 248792

URL: https://gcc.gnu.org/viewcvs?rev=248792&root=gcc&view=rev
Log:
DWARF: add DW_AT_location for global decls with DECL_VALUE_EXPR

In GNAT, we materialize renamings that cannot be described in standard
DWARF as synthetic variables that describe how to fetch the renamed
object.  Look for "___XR" in gcc/ada/exp_dbug.ads for more details about
this convention.

In order to have a location for these variables in the debug info (GDB
requires it not to discard the variable) but also to avoid allocating
runtime space for them, we make these variable hold a DECL_VALUE_EXPR
tree.  However, since GCC 7, the DWARF back-end no longer generates a
DW_AT_location attribute for those.  This patch is an attempt to restore
this attribute.

gcc/

	* dwarf2out.c (dwarf2out_late_global_decl): Add locations for
	symbols that hold a DECL_VALUE_EXPR.

gcc/testsuite/

	* debug12.adb, debug12.ads: New testcase.

Added:
    trunk/gcc/testsuite/gnat.dg/debug12.adb
    trunk/gcc/testsuite/gnat.dg/debug12.ads
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list