[Bug debug/49366] pointer-to-member-function not given value in DW_TAG_template_value_param

2016-08-12 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49366

Alexandre Oliva  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Alexandre Oliva  ---
Fixed

[Bug debug/49366] pointer-to-member-function not given value in DW_TAG_template_value_param

2016-08-12 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49366

--- Comment #4 from Alexandre Oliva  ---
Author: aoliva
Date: Fri Aug 12 07:11:23 2016
New Revision: 239401

URL: https://gcc.gnu.org/viewcvs?rev=239401=gcc=rev
Log:
[PR49366] emit loc exprs for C++ non-virtual pmf template value parms

We used to emit, in debug information, the values bound to pointer to
member function template parameters only when they were NULL or
virtual member functions, because those can be represented with
DW_AT_const_value.

In order to represent the symbolic pointer to member function
constants for non-virtual member functions, we'd need to be able to
emit relocations for part of DW_AT_const_value, which we don't.  The
more viable alternative is to use DW_AT_location to represent such
values, as slated for inclusion in DWARFv5, according to
.

With this patch, when we can't emit a DW_AT_const_value, we emit each
"member" of the pointer to member function "record" as a
DW_OP_stack_value DW_OP_piece, as long as the referenced member
function is output in the same translation unit, otherwise we'd get
relocations to external symbols, something to avoid in debug sections.


for  gcc/ChangeLog

PR debug/49366
* dwarf2out.c (loc_list_from_tree_1): Expand some CONSTRUCTORs
in DW_OP_pieces, just enough to handle pointers to member
functions.
(gen_remaining_tmpl_value_param_die_attribute): Use a location
expression on DWARFv5 if a constant value doesn't work.

for  gcc/testsuite/ChangeLog

PR debug/49366
* g++.dg/debug/dwarf2/template-params-12.H: New.
* g++.dg/debug/dwarf2/template-params-12f.C: New.
* g++.dg/debug/dwarf2/template-params-12g.C: New.
* g++.dg/debug/dwarf2/template-params-12n.C: New.
* g++.dg/debug/dwarf2/template-params-12s.C: New.
* g++.dg/debug/dwarf2/template-params-12u.C: New.
* g++.dg/debug/dwarf2/template-params-12v.C: New.
* g++.dg/debug/dwarf2/template-params-12w.C: New.

Added:
trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-12.H
trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-12f.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-12g.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-12n.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-12s.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-12u.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-12v.C
trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-12w.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog

[Bug debug/49366] pointer-to-member-function not given value in DW_TAG_template_value_param

2016-08-01 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49366

Alexandre Oliva  changed:

   What|Removed |Added

 CC||aoliva at gcc dot gnu.org
   Assignee|dodji at gcc dot gnu.org   |aoliva at gcc dot 
gnu.org

--- Comment #3 from Alexandre Oliva  ---
Created attachment 39045
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39045=edit
Patch I posted to gcc-patches

Mine

[Bug debug/49366] pointer-to-member-function not given value in DW_TAG_template_value_param

2014-06-25 Thread tromey at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49366

--- Comment #2 from Tom Tromey tromey at gcc dot gnu.org ---
(In reply to David Blaikie from comment #1)
 Any idea what value it should have? (how GDB would like to have the member
 function pointer encoded)

Sorry I didn't reply to this sooner.
Nope, no idea :-)
I think whatever is done here will need a corresponding gdb patch.


[Bug debug/49366] pointer-to-member-function not given value in DW_TAG_template_value_param

2013-05-10 Thread dblaikie at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49366

David Blaikie dblaikie at gmail dot com changed:

   What|Removed |Added

 CC||dblaikie at gmail dot com

--- Comment #1 from David Blaikie dblaikie at gmail dot com ---
Any idea what value it should have? (how GDB would like to have the member
function pointer encoded)


[Bug debug/49366] pointer-to-member-function not given value in DW_TAG_template_value_param

2011-06-10 Thread dodji at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49366

Dodji Seketeli dodji at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2011.06.10 18:48:56
 CC||dodji at gcc dot gnu.org
 AssignedTo|unassigned at gcc dot   |dodji at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1