Bug 11546 - CR: Python gdb.Type method template_argument fails for non-type template arguments
Summary: CR: Python gdb.Type method template_argument fails for non-type template argu...
Status: RESOLVED DUPLICATE of bug 11060
Alias: None
Product: gdb
Classification: Unclassified
Component: python (show other bugs)
Version: 7.1
: P2 normal
Target Milestone: 7.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-27 15:22 UTC by Ariel Shaqed (Scolnicov)
Modified: 2010-04-27 15:25 UTC (History)
1 user (show)

See Also:
Host: Linux ... 2.6.18-164.11.1.el5 #1 SMP Wed Jan 20 07:32:21 EST 201
Target:
Build:
Last reconfirmed:


Attachments
nontype.cc (145 bytes, text/x-c++src)
2010-04-27 15:23 UTC, Ariel Shaqed (Scolnicov)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ariel Shaqed (Scolnicov) 2010-04-27 15:22:05 UTC
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.
Comment 1 Ariel Shaqed (Scolnicov) 2010-04-27 15:23:03 UTC
Created attachment 4753 [details]
nontype.cc

Sample program for description.  Compile with:
   g++ -fno-inline -g3 ./nontype.cc -o nontype
then open in gdb.
Comment 2 Tom Tromey 2010-04-27 15:25:27 UTC

*** This bug has been marked as a duplicate of 11060 ***