aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/python
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-05-26 15:44:08 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-05-26 22:29:04 +0100
commit11e1ee1b38f0d3a825b0cb70122cb345636b0534 (patch)
tree8ad43a4cdab30c67440c73cfc8c1959bf029ca1c /libstdc++-v3/python
parentae3ea143ef4222707ce751f89f7b45d8f913caf3 (diff)
downloadgcc-11e1ee1b38f0d3a825b0cb70122cb345636b0534.zip
gcc-11e1ee1b38f0d3a825b0cb70122cb345636b0534.tar.gz
gcc-11e1ee1b38f0d3a825b0cb70122cb345636b0534.tar.bz2
libstdc++: Fix atomic and error_code printers for versioned namespace
This fixes the printers to work with std::__8::atomic and std::__v8::ios_errc and std::__v8::future_errc. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (StdErrorCodePrinter): Make lookup for ios_errc and future_errc check versioned namespace. (StdAtomicPrinter): Strip versioned namespace from typename.
Diffstat (limited to 'libstdc++-v3/python')
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/printers.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index d47f9f2..17c33c1 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -1552,6 +1552,15 @@ class StdErrorCodePrinter:
return None
@classmethod
+ def _find_standard_errc_enum(cls, name):
+ for ns in ['', _versioned_namespace]:
+ try:
+ qname = 'std::{}{}'.format(ns, name)
+ return cls._find_errc_enum(qname)
+ except RuntimeError:
+ pass
+
+ @classmethod
def _match_net_ts_category(cls, cat):
net_cats = ['stream', 'socket', 'ip::resolver']
for c in net_cats:
@@ -1592,10 +1601,10 @@ class StdErrorCodePrinter:
is_errno = cls._system_is_posix
if typ.tag.endswith('::future_error_category'):
name = 'future'
- enum = cls._find_errc_enum('std::future_errc')
+ enum = cls._find_standard_errc_enum('future_errc')
if typ.tag.endswith('::io_error_category'):
name = 'io'
- enum = cls._find_errc_enum('std::io_errc')
+ enum = cls._find_standard_errc_enum('io_errc')
if name is None:
try:
@@ -1725,7 +1734,7 @@ class StdAtomicPrinter:
"Print a std:atomic"
def __init__(self, typename, val):
- self.typename = typename
+ self.typename = strip_versioned_namespace(typename)
self.val = val
self.shptr_printer = None
self.value_type = self.val.type.template_argument(0)