]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix filesystem::path pretty printer test failure
authorJonathan Wakely <jwakely@redhat.com>
Wed, 2 Dec 2020 00:39:21 +0000 (00:39 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 11 Jan 2021 15:08:51 +0000 (15:08 +0000)
commitcb02e1d8a0083ea7137747520ecd87452f9e3c69
tree16ea5d10afcd0abf64e120fd058a077cd47ae093
parent93beee71a5ba5ee97a072d94780b140ae159fd74
libstdc++: Fix filesystem::path pretty printer test failure

On some systems libstdc++-prettyprinters/cxx17.cc FAILs with this error:

skipping: Python Exception <type 'exceptions.AttributeError'> 'gdb.Type' object has no attribute 'name': ^M
got: $27 = filesystem::path "/dir/."^M
FAIL: libstdc++-prettyprinters/cxx17.cc print path2

The gdb.Type.name attribute isn't present in GDB 7.6, so we get an
exception from StdPathPrinter._iterator.__next__ trying to use it.
The StdPathPrinter._iterator is already passed the type's name in its
constructor, so we can just store that and use it instead of
gdb.Type.name.

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/printers.py (StdExpPathPrinter): Store the
name of the type and pass it to the iterator.
(StdPathPrinter): Likewise.
* testsuite/libstdc++-prettyprinters/filesystem-ts.cc: New test.

(cherry picked from commit a70384f94c83895f97179b45c1a8d66202132af8)
libstdc++-v3/python/libstdcxx/v6/printers.py
libstdc++-v3/testsuite/libstdc++-prettyprinters/filesystem-ts.cc [new file with mode: 0644]