public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/11060] New: the template_argument function cannot handle value arguments
@ 2009-12-07 14:24 bschindler at inf dot ethz dot ch
  2009-12-07 18:04 ` [Bug python/11060] " ppluzhnikov at google dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: bschindler at inf dot ethz dot ch @ 2009-12-07 14:24 UTC (permalink / raw)
  To: gdb-prs

having the type 

Eigen::Matrix<double, 4, 1, 2, 4, 1> 

Executing template_argument(1) on the type gdb object (when doing a pretty
printer), I get the following: 

Traceback (most recent call last):                                             
                                             
  File "/home/bschindl/software/gdb-printer/eigen/printers.py", line 53, in
lookup_function                                  
    return pretty_printers_dict[function](val)                                 
                                             
  File "/home/bschindl/software/gdb-printer/eigen/printers.py", line 28, in
<lambda>                                         
    pretty_printers_dict[re.compile('^Eigen::Matrix<.*>$')] = lambda val:
EigenMatrixPrinter(val)                            
  File "/home/bschindl/software/gdb-printer/eigen/printers.py", line 18, in
__init__                                         
    self.rows = self.type.template_argument(1)                                 
                                             
RuntimeError: No type named 4.

-- 
           Summary: the template_argument function cannot handle value
                    arguments
           Product: gdb
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: python
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: bschindler at inf dot ethz dot ch
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=11060

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/11060] the template_argument function cannot handle value arguments
  2009-12-07 14:24 [Bug python/11060] New: the template_argument function cannot handle value arguments bschindler at inf dot ethz dot ch
@ 2009-12-07 18:04 ` ppluzhnikov at google dot com
  2010-01-25 20:06 ` tromey at redhat dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2009-12-07 18:04 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From ppluzhnikov at google dot com  2009-12-07 18:04 -------
Repro:

// gdb-pr11060.cc
template <int N> struct Foo { };

int main()
{
  Foo<42> f;
  return 0;
}
// --- cut ---

g++ -g -o gdb-pr11060 gdb-pr11060.cc

gdb64-cvs gdb-pr11060
GNU gdb (GDB) 7.0.50.20091203-cvs
...
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 /tmp/gdb-pr11060...done.
(gdb) b main
Breakpoint 1 at 0x40053c: file gdb-pr11060.cc, line 6.
(gdb) r

Breakpoint 1, main () at gdb-pr11060.cc:6
6         return 0;
(gdb) p f
$1 = {<No data fields>}
(gdb) py t = gdb.history(1)
(gdb) py print t.type.template_argument(0)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
RuntimeError: No type named 42.
Error while executing Python code.

Same problem on archer-tromey-python.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1


http://sourceware.org/bugzilla/show_bug.cgi?id=11060

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/11060] the template_argument function cannot handle value arguments
  2009-12-07 14:24 [Bug python/11060] New: the template_argument function cannot handle value arguments bschindler at inf dot ethz dot ch
  2009-12-07 18:04 ` [Bug python/11060] " ppluzhnikov at google dot com
@ 2010-01-25 20:06 ` tromey at redhat dot com
  2010-04-27 15:25 ` tromey at redhat dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at redhat dot com @ 2010-01-25 20:06 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From tromey at redhat dot com  2010-01-25 20:06 -------
*** Bug 10476 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lucienmp_antispam at yahoo
                   |                            |dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11060

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/11060] the template_argument function cannot handle value arguments
  2009-12-07 14:24 [Bug python/11060] New: the template_argument function cannot handle value arguments bschindler at inf dot ethz dot ch
  2009-12-07 18:04 ` [Bug python/11060] " ppluzhnikov at google dot com
  2010-01-25 20:06 ` tromey at redhat dot com
@ 2010-04-27 15:25 ` tromey at redhat dot com
  2010-05-24  6:22 ` pmuldoon at redhat dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at redhat dot com @ 2010-04-27 15:25 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From tromey at redhat dot com  2010-04-27 15:25 -------
*** Bug 11546 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ariels at correlix dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11060

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/11060] the template_argument function cannot handle value arguments
  2009-12-07 14:24 [Bug python/11060] New: the template_argument function cannot handle value arguments bschindler at inf dot ethz dot ch
                   ` (2 preceding siblings ...)
  2010-04-27 15:25 ` tromey at redhat dot com
@ 2010-05-24  6:22 ` pmuldoon at redhat dot com
  2010-05-25 17:48 ` tromey at redhat dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pmuldoon at redhat dot com @ 2010-05-24  6:22 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |9946


http://sourceware.org/bugzilla/show_bug.cgi?id=11060

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/11060] the template_argument function cannot handle value arguments
  2009-12-07 14:24 [Bug python/11060] New: the template_argument function cannot handle value arguments bschindler at inf dot ethz dot ch
                   ` (3 preceding siblings ...)
  2010-05-24  6:22 ` pmuldoon at redhat dot com
@ 2010-05-25 17:48 ` tromey at redhat dot com
  2010-05-26 15:27 ` tromey at redhat dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at redhat dot com @ 2010-05-25 17:48 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|9946                        |


http://sourceware.org/bugzilla/show_bug.cgi?id=11060

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/11060] the template_argument function cannot handle value arguments
  2009-12-07 14:24 [Bug python/11060] New: the template_argument function cannot handle value arguments bschindler at inf dot ethz dot ch
                   ` (4 preceding siblings ...)
  2010-05-25 17:48 ` tromey at redhat dot com
@ 2010-05-26 15:27 ` tromey at redhat dot com
  2010-07-28 16:25 ` tromey at redhat dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at redhat dot com @ 2010-05-26 15:27 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |9946


http://sourceware.org/bugzilla/show_bug.cgi?id=11060

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/11060] the template_argument function cannot handle value arguments
  2009-12-07 14:24 [Bug python/11060] New: the template_argument function cannot handle value arguments bschindler at inf dot ethz dot ch
                   ` (5 preceding siblings ...)
  2010-05-26 15:27 ` tromey at redhat dot com
@ 2010-07-28 16:25 ` tromey at redhat dot com
  2010-07-28 18:10 ` tromey at redhat dot com
  2010-07-28 21:04 ` tromey at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at redhat dot com @ 2010-07-28 16:25 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|9946                        |


http://sourceware.org/bugzilla/show_bug.cgi?id=11060

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/11060] the template_argument function cannot handle value arguments
  2009-12-07 14:24 [Bug python/11060] New: the template_argument function cannot handle value arguments bschindler at inf dot ethz dot ch
                   ` (6 preceding siblings ...)
  2010-07-28 16:25 ` tromey at redhat dot com
@ 2010-07-28 18:10 ` tromey at redhat dot com
  2010-07-28 21:04 ` tromey at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at redhat dot com @ 2010-07-28 18:10 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From tromey at redhat dot com  2010-07-28 18:10 -------
I'm working on a fix.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at sourceware dot|tromey at redhat dot com
                   |org                         |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-28 18:10:15
               date|                            |


http://sourceware.org/bugzilla/show_bug.cgi?id=11060

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/11060] the template_argument function cannot handle value arguments
  2009-12-07 14:24 [Bug python/11060] New: the template_argument function cannot handle value arguments bschindler at inf dot ethz dot ch
                   ` (7 preceding siblings ...)
  2010-07-28 18:10 ` tromey at redhat dot com
@ 2010-07-28 21:04 ` tromey at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at redhat dot com @ 2010-07-28 21:04 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2010-07-28 20:50 -------
Subject: Bug 11060

CVSROOT:	/cvs/src
Module name:	src
Changes by:	tromey@sourceware.org	2010-07-28 20:50:17

Modified files:
	gdb            : ChangeLog 
	gdb/python     : py-type.c 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.python: py-type.c py-type.exp 

Log message:
	gdb
	PR python/11060:
	* python/py-type.c (typy_legacy_template_argument): New function,
	extracted from typy_template_argument.
	(typy_template_argument): Use TYPE_TEMPLATE_ARGUMENT.  Return a
	value when needed.
	gdb/testsuite
	PR python/11060:
	* gdb.python/py-type.c (Temargs): New template.
	(temvar): New variable.
	* gdb.python/py-type.exp (test_template): New proc.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12042&r2=1.12043
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/py-type.c.diff?cvsroot=src&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2395&r2=1.2396
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/py-type.c.diff?cvsroot=src&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/py-type.exp.diff?cvsroot=src&r1=1.5&r2=1.6


------- Additional Comments From tromey at redhat dot com  2010-07-28 21:04 -------
I checked in a fix for this, but it only works if you have a new version of GCC.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11060

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2010-07-28 21:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-07 14:24 [Bug python/11060] New: the template_argument function cannot handle value arguments bschindler at inf dot ethz dot ch
2009-12-07 18:04 ` [Bug python/11060] " ppluzhnikov at google dot com
2010-01-25 20:06 ` tromey at redhat dot com
2010-04-27 15:25 ` tromey at redhat dot com
2010-05-24  6:22 ` pmuldoon at redhat dot com
2010-05-25 17:48 ` tromey at redhat dot com
2010-05-26 15:27 ` tromey at redhat dot com
2010-07-28 16:25 ` tromey at redhat dot com
2010-07-28 18:10 ` tromey at redhat dot com
2010-07-28 21:04 ` tromey at redhat dot com

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