Summary: | Vector pretty-printer chokes on bit-vectors | ||
---|---|---|---|
Product: | gdb | Reporter: | Paul Pluzhnikov <ppluzhnikov> |
Component: | python | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gdb-prs |
Priority: | P2 | ||
Version: | unknown | ||
Target Milestone: | 7.1 | ||
Host: | x86_64-unknown-linux-gnu | Target: | x86_64-unknown-linux-gnu |
Build: | x86_64-unknown-linux-gnu | Last reconfirmed: |
The fix is in gcc svn now. |
Test case: // --- cut --- bitvector.cc --- #include <vector> typedef std::vector<bool> BV; int main() { BV bv; bv.push_back(true); return 0; } // --- cut --- bitvector.cc --- Using gcc 4.6.0 20100803 (experimental): g++ -g bitvector.cc gdb ./a.out GNU gdb (GDB) 7.2.50.20100731-cvs ... (gdb) python >sys.path.insert(0, '/home/gcc-svn-install/share/gcc-4.6.0/python') >from libstdcxx.v6.printers import register_libstdcxx_printers >register_libstdcxx_printers (None) ^D (gdb) b main Breakpoint 1 at 0x4007fd: file bitvector.cc, line 7. (gdb) r Breakpoint 1, main () at bitvector.cc:7 7 BV bv; (gdb) n 8 bv.push_back(true); (gdb) p bv $1 = Traceback (most recent call last): File "/home/gcc-svn-install/share/gcc-4.6.0/python/libstdcxx/v6/printers.py", line 186, in to_string % (self.typename, int (finish - start), int (end - start))) RuntimeError: Argument to arithmetic operation not a number or boolean. Traceback (most recent call last): File "/home/gcc-svn-install/share/gcc-4.6.0/python/libstdcxx/v6/printers.py", line 169, in next elt = self.item.dereference() RuntimeError: Attempt to take contents of a non-pointer value.