I have C++ types containing non-type template parameters. In the attached program nontype.cc `eleven' is a variable of such a type. I cannot get at the template parameter n because of this limitation. Unfortunately in my real class such a parameter is relevant for pretty-printing. [ariels@...]$ gdb ~/dev/Tests/C++/nontype GNU gdb (GDB) 7.1 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/ariels/dev/Tests/C++/nontype...done. (gdb) b main Breakpoint 1 at 0x400530: file ./nontype.cc, line 11. (gdb) r Starting program: /home/ariels/dev/Tests/C++/nontype Breakpoint 1, main () at ./nontype.cc:11 11 return eleven.get(); (gdb) python print gdb.parse_and_eval('eleven').type F<11> (gdb) python print gdb.parse_and_eval('eleven').type.template_argument(0) Traceback (most recent call last): File "<string>", line 1, in ? RuntimeError: No type named 11. Error while executing Python code.
Created attachment 4753 [details] nontype.cc Sample program for description. Compile with: g++ -fno-inline -g3 ./nontype.cc -o nontype then open in gdb.
*** This bug has been marked as a duplicate of 11060 ***