This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/53477] pretty printer fails with: Python Exception <type 'exceptions.IndexError'> list index out of range


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

Tomasz Gajewski <tomga at wp dot pl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tomga at wp dot pl

--- Comment #8 from Tomasz Gajewski <tomga at wp dot pl> ---
The testcase can be reduced to:

#include <map>

typedef std::map<int, int> IntToIntMap;

int main()
{
  IntToIntMap amap;
  IntToIntMap & mapref = amap;
  amap[1] = 1;
  return 0;
}

and the problem is with map references. Executing on line with 'amap[1] = 1;'
commands to print 'amap' and 'mapref' I get:

(gdb) set python print-stack full
(gdb) p mapref
Traceback (most recent call last):
  File "/home/tomga/devel/gdb-scripts/python/libstdcxx/v6/printers.py", line
438, in children
    rep_type = find_type(self.val.type, '_Rep_type')
  File "/home/tomga/devel/gdb-scripts/python/libstdcxx/v6/printers.py", line
52, in find_type
    field = typ.fields()[0]
IndexError: list index out of range
$3 = std::map with 0 elements
(gdb) p amap
$4 = std::map with 0 elements

I get this with:

$ g++ --version
g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
...
$ gdb --version
GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu
...

Pretty printers from svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
(currently latest revision: 200105.

Currently I don't know how to debug this further.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]