[Bug libstdc++/53477] pretty printer fails with: Python Exception type 'exceptions.IndexError' list index out of range
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53477 --- Comment #24 from Tomasz Gajewski tomga at wp dot pl --- Well, they certainly did not at that time, so I think the bug can be closed.
[Bug libstdc++/53477] pretty printer fails with: Python Exception type 'exceptions.IndexError' list index out of range
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53477 --- Comment #22 from Tomasz Gajewski tomga at wp dot pl --- In comment #10 I've provided test patch to test case that exposed a problem (and in comment #11 some fix to all those tests). Currently I can't check if it applies cleanly and if errors occur. If you want probably I can find some time in next few weeks.
[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 --- Comment #10 from Tomasz Gajewski tomga at wp dot pl --- Created attachment 30473 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=30473action=edit Patch to pretty printers testsuite to expose some problems This patch adds into the testsuite additional cases with typedefs and references to variables. This exposes problem described in this bug. My proposed earlier patch to 'printers.py' fixes some new testcases from this patch but not all of them.
[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 --- Comment #11 from Tomasz Gajewski tomga at wp dot pl --- Created attachment 30474 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=30474action=edit Patch that fixes all testcases added by me in previous patch to simple.cc
[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 --- Comment #9 from Tomasz Gajewski tomga at wp dot pl --- Following patch seems to solve this problem although I don't like it very much. I think whole get_basic_type function should be moved to the beginning of printers.py. And additionally I'm not sure if this change does not break something somewhere else. If not I think get_basic_type and find_type should be merged into one function. If not calls to them should be replaced appappropriately. I leave it to someone else. Index: libstdcxx/v6/printers.py === --- libstdcxx/v6/printers.py(revision 200105) +++ libstdcxx/v6/printers.py(working copy) @@ -39,7 +39,7 @@ # handles searching upward through superclasses. This is needed to # work around http://sourceware.org/bugzilla/show_bug.cgi?id=13615. def find_type(orig, name): -typ = orig.strip_typedefs() +typ = Printer.get_basic_type(orig) while True: search = str(typ) + '::' + name try:
[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::mapint, 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.