public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/7932: Emit debug information about non-type template parameters
@ 2002-09-16 10:56 bangerth
  0 siblings, 0 replies; only message in thread
From: bangerth @ 2002-09-16 10:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7932
>Category:       c++
>Synopsis:       Emit debug information about non-type template parameters
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 16 10:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        unknown-1.0
>Organization:
>Environment:
gcc 3.2
>Description:
This is more like a feature request than a bug-report, so
is low priority. But it might be low-hanging fruit for
someone knowledgable about this kind of stuff:

It would be nice to have debug information about the values
of non-type template parameters, for example to evaluate
expressions including them (thus being able to just cut-and-
paste them from the program). I guess, these parameters
would then just appear as constant variables with a 
lifetime equal to the entire scope.

Example program and debug session:
----------------------
#include <cstdlib>

template <int dim> struct X {
    X(){ abort(); };
};

int main () {
  X<1> x;
};
-----------------

When executed, the program stops at the site of the abort.
In a debugger, then try this:
-----------------
(gdb) r
Starting program: /home/bangerth/tmp/gcc/a.out

Program received signal SIGABRT, Aborted.
0x40131ab1 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x40131ab1 in kill () from /lib/libc.so.6
#1  0x401318a8 in raise () from /lib/libc.so.6
#2  0x40132edb in abort () from /lib/libc.so.6
#3  0x080485ab in X<1>::X() () at x.cc:4
#4  0x0804855b in main () at x.cc:8
#5  0x401209ed in __libc_start_main () from /lib/libc.so.6
(gdb) fr 3
#3  0x080485ab in X<1>::X() () at x.cc:4
4           X(){ abort(); };
(gdb) p dim
No symbol "dim" in current context.

Regards
  Wolfgang
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-09-16 17:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-16 10:56 c++/7932: Emit debug information about non-type template parameters bangerth

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).