public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/30161]  New: GCC should generate dwarf info about template parameters
@ 2006-12-12  3:43 jason at gcc dot gnu dot org
  2006-12-12  6:33 ` [Bug debug/30161] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-12-12  3:43 UTC (permalink / raw)
  To: gcc-bugs

GCC doesn't currently generate DW_TAG_template_*_param, and it should to
improve C++ debuggability (and allow us to shorten the DW_AT_names of template
instantiations).


-- 
           Summary: GCC should generate dwarf info about template parameters
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: debug
        AssignedTo: jason at gcc dot gnu dot org
        ReportedBy: jason at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
  2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
@ 2006-12-12  6:33 ` pinskia at gcc dot gnu dot org
  2006-12-12  9:46 ` rguenth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-12  6:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-12-12 06:33 -------
This seems related to PR 7932.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |7932
              nThis|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
  2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
  2006-12-12  6:33 ` [Bug debug/30161] " pinskia at gcc dot gnu dot org
@ 2006-12-12  9:46 ` rguenth at gcc dot gnu dot org
  2008-11-08  0:58 ` tromey at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-12-12  9:46 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
OtherBugsDependingO|                            |29433
              nThis|                            |
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-12-12 09:45:45
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
  2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
  2006-12-12  6:33 ` [Bug debug/30161] " pinskia at gcc dot gnu dot org
  2006-12-12  9:46 ` rguenth at gcc dot gnu dot org
@ 2008-11-08  0:58 ` tromey at gcc dot gnu dot org
  2008-12-02  9:06 ` dodji at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-11-08  0:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tromey at gcc dot gnu dot org  2008-11-08 00:57 -------
*** Bug 38058 has been marked as a duplicate of this bug. ***


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
  2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-11-08  0:58 ` tromey at gcc dot gnu dot org
@ 2008-12-02  9:06 ` dodji at gcc dot gnu dot org
  2008-12-15 10:03 ` dodji at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2008-12-02  9:06 UTC (permalink / raw)
  To: gcc-bugs



-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|jason at gcc dot gnu dot org|dodji at gcc dot gnu dot org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-12-12 09:45:45         |2008-12-02 09:01:51
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
  2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-12-02  9:06 ` dodji at gcc dot gnu dot org
@ 2008-12-15 10:03 ` dodji at gcc dot gnu dot org
  2008-12-26 18:33 ` dodji at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2008-12-15 10:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dodji at gcc dot gnu dot org  2008-12-15 10:01 -------
Started looking at this. Got a work in progress patch at
http://www.seketeli.org/dodji/patches/gcc/PR30161-patch.txt. It's not ready for
review yet, I am just backuping it online.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
  2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-12-15 10:03 ` dodji at gcc dot gnu dot org
@ 2008-12-26 18:33 ` dodji at gcc dot gnu dot org
  2009-03-11 17:17 ` dodji at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2008-12-26 18:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dodji at gcc dot gnu dot org  2008-12-26 18:32 -------
More work-in-progress patches for this PR can be checked out at
http://www.seketeli.org/dodji/patches/gcc/PR30161 .
Please note that each patch there is self contained and passes regtests on
x86_64. The tests accompanying the patches also passes.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
  2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-12-26 18:33 ` dodji at gcc dot gnu dot org
@ 2009-03-11 17:17 ` dodji at gcc dot gnu dot org
  2009-03-11 17:55 ` dodji at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-03-11 17:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dodji at gcc dot gnu dot org  2009-03-11 17:16 -------
Work in progress patches are now at
http://people.redhat.com/~dseketel/gcc/PR30161


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
  2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-03-11 17:17 ` dodji at gcc dot gnu dot org
@ 2009-03-11 17:55 ` dodji at gcc dot gnu dot org
  2009-08-13 19:24 ` dodji at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-03-11 17:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dodji at gcc dot gnu dot org  2009-03-11 17:54 -------
Quick Status of
http://people.redhat.com/~dseketel/gcc/PR30161/PR30161-patch-v4.txt:

The patch generates DW_TAG_template_type_param and DW_TAG_template_value_param
for template type parameters as well as non-type parameters. Debug info for
template parameter packs (parameters of variadic templates) are also generated.

Template template parameters are not supported as it seems the DWARF3 spec
doesn't support those. Please look at the examples at the end of the patch to
see the type of template parameters for which debug info is generated by the
patch today.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
  2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2009-03-11 17:55 ` dodji at gcc dot gnu dot org
@ 2009-08-13 19:24 ` dodji at gcc dot gnu dot org
  2009-08-31 21:48 ` dodji at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-08-13 19:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dodji at gcc dot gnu dot org  2009-08-13 19:24 -------
A candidate patch was sent to
http://gcc.gnu.org/ml/gcc-patches/2009-08/msg00703.html .


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
  2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2009-08-13 19:24 ` dodji at gcc dot gnu dot org
@ 2009-08-31 21:48 ` dodji at gcc dot gnu dot org
  2009-08-31 21:55 ` dodji at gcc dot gnu dot org
  2009-09-01  8:46 ` dodji at gcc dot gnu dot org
  11 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-08-31 21:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dodji at gcc dot gnu dot org  2009-08-31 21:48 -------
Subject: Bug 30161

Author: dodji
Date: Mon Aug 31 21:48:04 2009
New Revision: 151249

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151249
Log:
Emit DWARF for template parameters (PR debug/30161)

ChangeLog:
        PR debug/30161
        * include/dwarf2.h (enum dwarf_tag): Added
        DW_TAG_GNU_template_template_param
        (enum dwarf_attribute): Added DW_AT_GNU_template_name.

gcc/ChangeLog:
        PR debug/30161
        * cgraph.h (cgraph_get_node): Declare ...
        * cgraph.c (cgraph_get_node): ... new function.
        * dwarf2out.c (gen_generic_params_dies,
        generic_parameter_die, tree_add_const_value_attribute_for_decl,
        make_ith_pack_parameter_name,
        append_entry_to_tmpl_value_parm_die_table,
        gen_remaining_tmpl_value_param_die_attribute): New functions.
        (gen_subprogram_die): Generate debug info for template parameters
        if debug info level is higher than DINFO_LEVEL_TERSE.
        Use tree_add_const_value_attribute_for_decl instead of
        tree_add_const_value_attribute.
        (gen_const_die): Use tree_add_const_value_attribute_for_decl
        instead of tree_add_const_value_attribute.
        (gen_struct_or_union_type_die): Generate debug
        info for template parameters if debug info level is higher than
        DINFO_LEVEL_TERSE.
        (tree_add_const_value_attribute): Handle integral and pointer
        constants. Update comment.
        (dwarf_tag_name): Support DW_TAG_GNU_template_template_param.
        (dwarf_attr_name): Support DW_AT_GNU_template_name.
        (reference_to_unused): Fix thinko. Remove redundant predicates from
        tests.
        (tree_add_const_value_attribute): Make this work for constant
        expressions only.
        tree_add_const_value_attribute_for_decl is to be used for variable
        DECLs now.
        (add_location_or_const_value_attribute): Use
        tree_add_const_value_attribute_for_decl now.
        (dwarf2out_finish): Emit the DW_AT_const_value attribute of
        DW_TAG_template_value_param DIEs after function DIEs have been
        emitted.
        * langhooks.h (lang_hooks_for_types): Add
        get_argument_pack_elems.
        (lang_hooks_for_decls): Add generic_generic_parameter_decl_p.
        (lang_hooks): Added get_innermost_generic_parms,
        get_innermost_generic_args.
        * langhooks-def.h (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
        LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
        LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
        LANG_HOOKS_GENERIC_GENERIC_PARAMETER_DECL_P): New language hooks.

gcc/cp/ChangeLog:
        PR debug/30161
        * cp-tree.h (get_template_info): Parameter should be const.
        (CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): Fix typo.
        (get_template_argument_pack_elems,
        get_primary_template_innermost_parameters,
        get_template_innermost_arguments, template_template_parameter_p):
        Declare ...
        * pt.c (get_template_argument_pack_elems,
        get_template_innermost_parameters, get_template_innermost_arguments,
        template_template_parameter_p):
        ... New C++ front end implementation of new language hooks.
        (primary_template_instantiation_p): New private helper.
        (make_ith_pack_parameter_name): Use snprintf and strnlen instead of
        printf and strlen.
        (get_template_info): Const-ify parameter.
        * cp-lang.c (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
        LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
        LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
        LANG_HOOKS_GENERIC_TYPE_PARAMETER_DECL_P): Initialize these
        interfaces for the C++ front-end.

gcc/testsuite/ChangeLog:
        PR debug/30161
        * g++.dg/debug/dwarf2/template-params-1.C: New test.
        * g++.dg/debug/dwarf2/template-params-2.C: Likewise.
        * g++.dg/debug/dwarf2/template-params-3.C: Likewise.
        * g++.dg/debug/dwarf2/template-params-4.C: Likewise.
        * g++.dg/debug/dwarf2/template-params-5.C: Likewise.
        * g++.dg/debug/dwarf2/template-params-6.C: Likewise.
        * g++.dg/debug/dwarf2/template-func-params-1.C: Likewise.
        * g++.dg/debug/dwarf2/template-func-params-2.C: Likewise.
        * g++.dg/debug/dwarf2/template-func-params-3.C: Likewise.
        * g++.dg/debug/dwarf2/template-func-params-4.C: Likewise.
        * g++.dg/debug/dwarf2/template-func-params-5.C: Likewise.
        * g++.dg/debug/dwarf2/template-func-params-6.C: Likewise.
        * g++.dg/debug/dwarf2/template-func-params-7.C: Likewise.

Added:
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-1.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-2.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-3.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-4.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-5.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-6.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-1.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-2.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-3.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-4.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-5.C
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/template-params-6.C
Modified:
    trunk/ChangeLog
    trunk/gcc/ChangeLog
    trunk/gcc/cgraph.c
    trunk/gcc/cgraph.h
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-lang.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/pt.c
    trunk/gcc/dwarf2out.c
    trunk/gcc/langhooks-def.h
    trunk/gcc/langhooks.h
    trunk/gcc/testsuite/ChangeLog
    trunk/include/dwarf2.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
  2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2009-08-31 21:48 ` dodji at gcc dot gnu dot org
@ 2009-08-31 21:55 ` dodji at gcc dot gnu dot org
  2009-09-01  8:46 ` dodji at gcc dot gnu dot org
  11 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-08-31 21:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from dodji at gcc dot gnu dot org  2009-08-31 21:55 -------
Fixed in trunk.

This patch implements some GNU extensions to represent template parameter packs
and template template parameters. The extension is documented at
http://gcc.gnu.org/wiki/TemplateParmsDwarf .

Now I guess some discussions should happen at the DWARF level to know see how
the GNU extension can evolve and turn into a proper DWARF proposal. So this
patch might see some modifications in a near future.

I will open other bugs for that in due time.


-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
  2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2009-08-31 21:55 ` dodji at gcc dot gnu dot org
@ 2009-09-01  8:46 ` dodji at gcc dot gnu dot org
  11 siblings, 0 replies; 14+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-09-01  8:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from dodji at gcc dot gnu dot org  2009-09-01 08:46 -------
Subject: Bug 30161

Author: dodji
Date: Tue Sep  1 08:45:38 2009
New Revision: 151262

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151262
Log:
Fix bootstrap after patch PR debug/30161

gcc/ChangeLog:
        PR bootstrap/41205
        Fix AIX bootstrap after PR debug/30161
        * dwarf2out.c (make_ith_pack_parameter_name): Don't used strnlen
        that is a GNU extension.
        (tmpl_value_parm_die_table): Move the definition of this global
        outside #ifdef DWARF2_DEBUGGING_INFO region.

gcc/cp/ChangeLog:
        PR bootstrap/41205
        * pt.c (make_ith_pack_parameter_name): Don't use strnlen that is a
        GNU extension.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/dwarf2out.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug debug/30161] GCC should generate dwarf info about template parameters
       [not found] <bug-30161-4@http.gcc.gnu.org/bugzilla/>
@ 2011-05-23 17:16 ` tromey at gcc dot gnu.org
  0 siblings, 0 replies; 14+ messages in thread
From: tromey at gcc dot gnu.org @ 2011-05-23 17:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30161

--- Comment #11 from Tom Tromey <tromey at gcc dot gnu.org> 2011-05-23 16:34:27 UTC ---
See PR 33861 for another example of where an extension
would seem to be necessary.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-05-23 17:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-12  3:43 [Bug debug/30161] New: GCC should generate dwarf info about template parameters jason at gcc dot gnu dot org
2006-12-12  6:33 ` [Bug debug/30161] " pinskia at gcc dot gnu dot org
2006-12-12  9:46 ` rguenth at gcc dot gnu dot org
2008-11-08  0:58 ` tromey at gcc dot gnu dot org
2008-12-02  9:06 ` dodji at gcc dot gnu dot org
2008-12-15 10:03 ` dodji at gcc dot gnu dot org
2008-12-26 18:33 ` dodji at gcc dot gnu dot org
2009-03-11 17:17 ` dodji at gcc dot gnu dot org
2009-03-11 17:55 ` dodji at gcc dot gnu dot org
2009-08-13 19:24 ` dodji at gcc dot gnu dot org
2009-08-31 21:48 ` dodji at gcc dot gnu dot org
2009-08-31 21:55 ` dodji at gcc dot gnu dot org
2009-09-01  8:46 ` dodji at gcc dot gnu dot org
     [not found] <bug-30161-4@http.gcc.gnu.org/bugzilla/>
2011-05-23 17:16 ` tromey at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).