[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 #25 from Jonathan Wakely redi at gcc dot gnu.org --- Pawel, since you say you still see problems could you please provide a testcase that actually links?
[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 #23 from Jonathan Wakely redi at gcc dot gnu.org --- (In reply to Tomasz Gajewski from comment #22) 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. It applies cleanly, but all the tests pass for me.
[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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53477 Jonathan Wakely redi at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed||2015-05-22 Ever confirmed|0 |1 --- Comment #21 from Jonathan Wakely redi at gcc dot gnu.org --- If this is still a problem please provide a complete testcase that reproduces it (one that actually links!)
[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 #20 from JiYouguo jiyouguo at gmail dot com --- Got it. Thank you very much. :) 2014-05-06 17:11 GMT+08:00 redi at gcc dot gnu.org gcc-bugzi...@gcc.gnu.org : http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53477 --- Comment #19 from Jonathan Wakely redi at gcc dot gnu.org --- (In reply to JiYouguo from comment #18) Would you mind telling how to patch a bug? I just can't find the file simple.cc. simple.cc is a test file, patching that won't fix anything. The patch you want is probably comment 11 -- You are receiving this mail because: You are on the CC list for the bug.
[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 JiYouguo jiyouguo at gmail dot com changed: What|Removed |Added CC||jiyouguo at gmail dot com --- Comment #18 from JiYouguo jiyouguo at gmail dot com --- (In reply to Pawel Sikora from comment #17) Would you mind telling how to patch a bug? I just can't find the file simple.cc. pure gcc 4.9.0 20140106 still fails: Breakpoint 2, main () at pr53477.cpp:15 (gdb) p wordBitsetMap $1 = std::map with 1 elementsTraceback (most recent call last): File /home/pawels/gcc/4.9/share/gcc-4.9.0/python/libstdcxx/v6/printers.py, line 438, in children rep_type = find_type(self.val.type, '_Rep_type') File /home/pawels/gcc/4.9/share/gcc-4.9.0/python/libstdcxx/v6/printers.py, line 54, in find_type raise ValueError, Cannot find type %s::%s % (str(orig), name) ValueError: Cannot find type const std::mapunsigned int, std::mapunsigned int, std::setunsigned int, std::__7::lessunsigned int, std::__7::allocatorunsigned int , std: :__7::lessunsigned int, std::__7::allocatorstd::__7::pairunsigned int const, std::setunsigned int, std::__7::lessunsigned int, std::__7::allocatorunsigned int , std::__7::lessunsigned int, std::__7::allocatorstd::__7::pairunsigned int const, std::mapunsigned int, std::setunsigned int, std::__7::lessunsigned int, std::__7::al locatorunsigned int , std::__7::lessunsigned int, std::__7::allocatorstd::__7::pairunsigned int const, std::setunsigned int, std::__7::lessunsigned int, std::__7::al locatorunsigned int ::mapped_type::_Rep_type patch propses in comment #10 works for me: Breakpoint 2, main () at pr53477.cpp:15 (gdb) p wordBitsetMap $1 = std::map with 1 elements = { [3] = std::set with 2 elements = { [0] = 1, [1] = 5 } }
[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 #19 from Jonathan Wakely redi at gcc dot gnu.org --- (In reply to JiYouguo from comment #18) Would you mind telling how to patch a bug? I just can't find the file simple.cc. simple.cc is a test file, patching that won't fix anything. The patch you want is probably comment 11
[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 #17 from Pawel Sikora pluto at agmk dot net --- pure gcc 4.9.0 20140106 still fails: Breakpoint 2, main () at pr53477.cpp:15 (gdb) p wordBitsetMap $1 = std::map with 1 elementsTraceback (most recent call last): File /home/pawels/gcc/4.9/share/gcc-4.9.0/python/libstdcxx/v6/printers.py, line 438, in children rep_type = find_type(self.val.type, '_Rep_type') File /home/pawels/gcc/4.9/share/gcc-4.9.0/python/libstdcxx/v6/printers.py, line 54, in find_type raise ValueError, Cannot find type %s::%s % (str(orig), name) ValueError: Cannot find type const std::mapunsigned int, std::mapunsigned int, std::setunsigned int, std::__7::lessunsigned int, std::__7::allocatorunsigned int , std: :__7::lessunsigned int, std::__7::allocatorstd::__7::pairunsigned int const, std::setunsigned int, std::__7::lessunsigned int, std::__7::allocatorunsigned int , std::__7::lessunsigned int, std::__7::allocatorstd::__7::pairunsigned int const, std::mapunsigned int, std::setunsigned int, std::__7::lessunsigned int, std::__7::al locatorunsigned int , std::__7::lessunsigned int, std::__7::allocatorstd::__7::pairunsigned int const, std::setunsigned int, std::__7::lessunsigned int, std::__7::al locatorunsigned int ::mapped_type::_Rep_type patch propses in comment #10 works for me: Breakpoint 2, main () at pr53477.cpp:15 (gdb) p wordBitsetMap $1 = std::map with 1 elements = { [3] = std::set with 2 elements = { [0] = 1, [1] = 5 } }
[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 Pawel Sikora pluto at agmk dot net changed: What|Removed |Added Known to fail||4.9.0 --- Comment #16 from Pawel Sikora pluto at agmk dot net --- (In reply to Phil Muldoon from comment #14) It should be fixed for all cases in the PR. I think we can close it, and if any of the people commenting on this bug have issues, they can reopen it. My pmuld...@redhat.com account does not have sufficient privileges to alter the state of the bug, or the assignee. (Though I did not try with my gcc.gnu.org account) i still see a failure: (gdb) p wordBitsetMap $1 = Python Exception type 'exceptions.ValueError' Cannot find type const std::mapunsigned int, std::mapunsigned int, std::setunsigned int, std::__7::les sunsigned int, std::__7::allocatorunsigned int , std::__7::lessunsigned int, std::__7::allocatorstd::__7::pairunsigned int const, std::setunsigned i nt, std::__7::lessunsigned int, std::__7::allocatorunsigned int, std::__7::lessunsigned int, std::__7::allocatorstd::__7::pairunsigned int con st, std::mapunsigned int, std::setunsigned int, std::__7::lessunsigned int, std::__7::allocatorunsigned int , std::__7::lessunsigned int, std::__7::a llocatorstd::__7::pairunsigned int const, std::setunsigned int, std::__7::lessunsigned int, std::__7::allocatorunsigned int ::mapped_type: :_Rep_type: std::map with 1 elements previously it failed with: (gdb) p wordBitsetMap $1 = Python Exception type 'exceptions.IndexError' list index out of range: std::map with 1 elements
[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 Phil Muldoon pmuldoon at redhat dot com changed: What|Removed |Added CC||pmuldoon at redhat dot com --- Comment #12 from Phil Muldoon pmuldoon at redhat dot com --- I checked in a patch to fix this yesterday. Not sure why the bug did not auto-update. Here is the link to the patch: http://gcc.gnu.org/ml/gcc-cvs/2013-08/msg00497.html Author: pmuldoon Date: Tue Aug 20 19:20:42 2013 New Revision: 201888 URL: http://gcc.gnu.org/viewcvs?rev=201888root=gccview=rev Log: 2013-08-20 Phil Muldoon pmuld...@redhat.com PR libstdc++/53477 http://sourceware.org/bugzilla/show_bug.cgi?id=15195 * python/libstdcxx/v6/printers.py (Printer.__call__): If a value is a reference, fetch referenced value. (RxPrinter.invoke): Ditto. * testsuite/libstdc++-prettyprinters/cxx11.cc (main): Add -O0 flag. Add referenced value tests. Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/python/libstdcxx/v6/printers.py trunk/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.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 #13 from Jonathan Wakely redi at gcc dot gnu.org --- (In reply to Phil Muldoon from comment #12) I checked in a patch to fix this yesterday. Not sure why the bug did not auto-update. Unfortunately after the sourceware.org hardware upgrade the script to update bugzilla from commits was lost or disabled, and noone's restored it. Thanks for adding the commit details manually, most of us don't bother because it adds a step to the process and is quite tedious when you're making lots of commits. Is this RESOLVED now then?
[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 #14 from Phil Muldoon pmuldoon at redhat dot com --- It should be fixed for all cases in the PR. I think we can close it, and if any of the people commenting on this bug have issues, they can reopen it. My pmuld...@redhat.com account does not have sufficient privileges to alter the state of the bug, or the assignee. (Though I did not try with my gcc.gnu.org account)
[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 Marek Polacek mpolacek at gcc dot gnu.org changed: What|Removed |Added CC||mpolacek at gcc dot gnu.org --- Comment #15 from Marek Polacek mpolacek at gcc dot gnu.org --- With your gcc.gnu.org account it should work.
[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.
[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 #6 from asmwarrior asmwarrior at gmail dot com --- Hi, all, I create a simple c++ program to reproduce this bug: #include set #include map typedef std::setint IntSet; typedef std::mapint, IntSet IntToSetMap; int main() { IntToSetMap m; IntSet s; s.insert(5); m[3] = s; IntSet refSet = m[3]; refSet.insert(6); return 0; } Now, you can set a BP in the line refSet.insert(6);, and run the command p refSet, you will get the error message. Python Exception type 'exceptions.IndexError' list index out of range: $1 = std::set with 1 elements If you run n, and then type p refSet again, you get: Python Exception type 'exceptions.IndexError' list index out of range: $2 = std::set with 2 elements It looks like the elements number(from 1 to 2) is correct. Thanks Yuanhui Zhang
[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 #7 from asmwarrior asmwarrior at gmail dot com --- Ok, I found another issue on the line return 0, see the GDB log: [debug] p m [debug]$2 = std::map with 1 elements = {[3] = std::set with 2 elements = {[0] = 5, [1] = 6}} [debug]cb_gdb: [debug] p m[3] [debug]Attempt to take address of value not located in memory. [debug]cb_gdb: p m shows the correct value, but I'm not sure why p m[3] failed? Is it a GDB bug?
[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 asmwarrior asmwarrior at gmail dot com changed: What|Removed |Added CC||asmwarrior at gmail dot com --- Comment #3 from asmwarrior asmwarrior at gmail dot com --- I have the same error when try to print a stl container, see the log: (this happens when I debug Code::Blocks), I'm using GCC 4.6.3 and GDB CVS HEAD. [debug] p m_Headers [debug]Python Exception type 'exceptions.IndexError' list index out of range: [debug]$2 = std::set with 1 elements [debug]cb_gdb:
[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 #4 from asmwarrior asmwarrior at gmail dot com --- This is what I get when I enable the python stack print: set python print-stack full [debug] set python print-stack full [debug]cb_gdb: p m_Headers [debug] p m_Headers [debug]Traceback (most recent call last): [debug] File E:\code\gcc\PCXMinGW463\bin\libstdcxx\v6\printers.py, line 477, in children [debug]rep_type = find_type(self.val.type, '_Rep_type') [debug] File E:\code\gcc\PCXMinGW463\bin\libstdcxx\v6\printers.py, line 52, in find_type [debug]field = typ.fields()[0] [debug]IndexError: list index out of range [debug]$3 = std::set with 1 elements [debug]cb_gdb: Thanks.
[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 #5 from asmwarrior asmwarrior at gmail dot com --- p /r m_Headers [debug] p /r m_Headers [debug]$5 = (StringSet ) @0x116d0bc4: {_M_t = {_M_impl = {std::allocatorstd::_Rb_tree_nodewxString = {__gnu_cxx::new_allocatorstd::_Rb_tree_nodewxString = {No data fields}, No data fields}, _M_key_compare = {std::binary_functionwxString, wxString, bool = {No data fields}, No data fields}, _M_header = {_M_color = std::_S_red, _M_parent = 0x116d2d28, _M_left = 0x116d2d28, _M_right = 0x116d2d28}, _M_node_count = 1}}} [debug]cb_gdb: When I see the E:\code\gcc\PCXMinGW463\bin\libstdcxx\v6\printers.py, I see in the line: 476 def children (self): rep_type = find_type(self.val.type, '_Rep_type') node = find_type(rep_type, '_Link_type') node = node.strip_typedefs() return self._iter (RbtreeIterator (self.val), node) The variable is declared as: StringSet m_Headers; and the StringSet is defined as: typedef std::setwxString StringSet; Hope those information can help to solve this bug.
[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 Andrew Pinski pinskia at gcc dot gnu.org changed: What|Removed |Added Target Milestone|3.1.x/3.2.x |---
[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 #2 from Pawel Sikora pluto at agmk dot net 2012-07-16 19:03:27 UTC --- (In reply to comment #1) (Fixed the component) I can't reproduce this. I can print wordMapBitset before it is initialized but I get a different error: (gdb) p wordBitsetMap $4 = std::map with 140737488349518 elementsCannot access memory at address 0x68732f6c61636f7c in line 15 the wordBitsetMap reference is initialized. (gdb) p wordBitsetMap $3 = Python Exception type 'exceptions.IndexError' list index out of range: std::map with 1 elements ^^^ this is true. What version of gdb are you using? gdb from git 7.4/master branch. Can you do it with stack-printing enabled? (set python print-stack on in recent versions, somewhere under maint in older ones.) This might help. (gdb) set python print-stack full (gdb) p wordBitsetMap $6 = std::map with 1 elementsTraceback (most recent call last): File /opt/gcc47/share/gcc-4.7.2/python/libstdcxx/v6/printers.py, line 427, in children rep_type = find_type(self.val.type, '_Rep_type') File /opt/gcc47/share/gcc-4.7.2/python/libstdcxx/v6/printers.py, line 43, in find_type field = typ.fields()[0] IndexError: list index out of range
[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 Tom Tromey tromey at gcc dot gnu.org changed: What|Removed |Added Target Milestone|--- |3.1.x/3.2.x --- Comment #1 from Tom Tromey tromey at gcc dot gnu.org 2012-07-13 18:38:18 UTC --- (Fixed the component) I can't reproduce this. I can print wordMapBitset before it is initialized but I get a different error: (gdb) p wordBitsetMap $4 = std::map with 140737488349518 elementsCannot access memory at address 0x68732f6c61636f7c ... which isn't pretty but is at least vaguely understandable as GIGO. What version of gdb are you using? Can you do it with stack-printing enabled? (set python print-stack on in recent versions, somewhere under maint in older ones.) This might help.