libstdc++: Fix pretty printer warnings.

These warnings are fixed in a newer version of libstdc++.
This commit is contained in:
meator 2023-12-09 22:13:37 +01:00 committed by Đoàn Trần Công Danh
parent 394982173f
commit 0c33716c19
2 changed files with 126 additions and 1 deletions

View file

@ -0,0 +1,125 @@
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -1198,7 +1198,7 @@
def __init__ (self, typename, val):
self.typename = strip_versioned_namespace(typename)
- self.typename = re.sub('^std::experimental::fundamentals_v\d::', 'std::experimental::', self.typename, 1)
+ self.typename = re.sub(r'^std::experimental::fundamentals_v\d::', 'std::experimental::', self.typename, 1)
self.val = val
self.contained_type = None
contained_value = None
@@ -1216,7 +1216,7 @@
mgrname = m.group(1)
# FIXME need to expand 'std::string' so that gdb.lookup_type works
if 'std::string' in mgrname:
- mgrname = re.sub("std::string(?!\w)", str(gdb.lookup_type('std::string').strip_typedefs()), m.group(1))
+ mgrname = re.sub(r"std::string(?!\w)", str(gdb.lookup_type('std::string').strip_typedefs()), m.group(1))
mgrtype = gdb.lookup_type(mgrname)
self.contained_type = mgrtype.template_argument(0)
@@ -1246,7 +1246,7 @@
def __init__ (self, typename, val):
valtype = self._recognize (val.type.template_argument(0))
typename = strip_versioned_namespace(typename)
- self.typename = re.sub('^std::(experimental::|)(fundamentals_v\d::|)(.*)', r'std::\1\3<%s>' % valtype, typename, 1)
+ self.typename = re.sub(r'^std::(experimental::|)(fundamentals_v\d::|)(.*)', r'std::\1\3<%s>' % valtype, typename, 1)
payload = val['_M_payload']
if self.typename.startswith('std::experimental'):
engaged = val['_M_engaged']
diff '--color=auto' -Naur a/libstdc++-v3/python/libstdcxx/v6/xmethods.py b/libstdc++-v3/python/libstdcxx/v6/xmethods.py
--- a/libstdc++-v3/python/libstdcxx/v6/xmethods.py 2022-08-19 08:09:55.524700157 +0000
+++ b/libstdc++-v3/python/libstdcxx/v6/xmethods.py 2023-12-09 21:06:42.544909771 +0000
@@ -148,7 +148,7 @@
self.methods = [self._method_dict[m] for m in self._method_dict]
def match(self, class_type, method_name):
- if not re.match('^std::(__\d+::)?array<.*>$', class_type.tag):
+ if not re.match(r'^std::(__\d+::)?array<.*>$', class_type.tag):
return None
method = self._method_dict.get(method_name)
if method is None or not method.enabled:
@@ -265,7 +265,7 @@
self.methods = [self._method_dict[m] for m in self._method_dict]
def match(self, class_type, method_name):
- if not re.match('^std::(__\d+::)?deque<.*>$', class_type.tag):
+ if not re.match(r'^std::(__\d+::)?deque<.*>$', class_type.tag):
return None
method = self._method_dict.get(method_name)
if method is None or not method.enabled:
@@ -309,7 +309,7 @@
self.methods = [self._method_dict[m] for m in self._method_dict]
def match(self, class_type, method_name):
- if not re.match('^std::(__\d+::)?forward_list<.*>$', class_type.tag):
+ if not re.match(r'^std::(__\d+::)?forward_list<.*>$', class_type.tag):
return None
method = self._method_dict.get(method_name)
if method is None or not method.enabled:
@@ -390,7 +390,7 @@
self.methods = [self._method_dict[m] for m in self._method_dict]
def match(self, class_type, method_name):
- if not re.match('^std::(__\d+::)?(__cxx11::)?list<.*>$', class_type.tag):
+ if not re.match(r'^std::(__\d+::)?(__cxx11::)?list<.*>$', class_type.tag):
return None
method = self._method_dict.get(method_name)
if method is None or not method.enabled:
@@ -505,7 +505,7 @@
self.methods = [self._method_dict[m] for m in self._method_dict]
def match(self, class_type, method_name):
- if not re.match('^std::(__\d+::)?vector<.*>$', class_type.tag):
+ if not re.match(r'^std::(__\d+::)?vector<.*>$', class_type.tag):
return None
method = self._method_dict.get(method_name)
if method is None or not method.enabled:
@@ -554,7 +554,7 @@
self.methods = [self._method_dict[m] for m in self._method_dict]
def match(self, class_type, method_name):
- if not re.match('^std::(__\d+::)?%s<.*>$' % self._name, class_type.tag):
+ if not re.match(r'^std::(__\d+::)?%s<.*>$' % self._name, class_type.tag):
return None
method = self._method_dict.get(method_name)
if method is None or not method.enabled:
@@ -587,9 +587,9 @@
def __call__(self, obj):
impl_type = obj.dereference().type.fields()[0].type.tag
# Check for new implementations first:
- if re.match('^std::(__\d+::)?__uniq_ptr_(data|impl)<.*>$', impl_type):
+ if re.match(r'^std::(__\d+::)?__uniq_ptr_(data|impl)<.*>$', impl_type):
tuple_member = obj['_M_t']['_M_t']
- elif re.match('^std::(__\d+::)?tuple<.*>$', impl_type):
+ elif re.match(r'^std::(__\d+::)?tuple<.*>$', impl_type):
tuple_member = obj['_M_t']
else:
return None
@@ -651,7 +651,7 @@
self.methods = [self._method_dict[m] for m in self._method_dict]
def match(self, class_type, method_name):
- if not re.match('^std::(__\d+::)?unique_ptr<.*>$', class_type.tag):
+ if not re.match(r'^std::(__\d+::)?unique_ptr<.*>$', class_type.tag):
return None
method = self._method_dict.get(method_name)
if method is None or not method.enabled:
@@ -720,7 +720,7 @@
def __call__(self, obj, index):
# Check bounds if _elem_type is an array of known bound
- m = re.match('.*\[(\d+)]$', str(self._elem_type))
+ m = re.match(r'.*\[(\d+)]$', str(self._elem_type))
if m and index >= int(m.group(1)):
raise IndexError('shared_ptr<%s> index "%d" should not be >= %d.' %
(self._elem_type, int(index), int(m.group(1))))
@@ -769,7 +769,7 @@
self.methods = [self._method_dict[m] for m in self._method_dict]
def match(self, class_type, method_name):
- if not re.match('^std::(__\d+::)?shared_ptr<.*>$', class_type.tag):
+ if not re.match(r'^std::(__\d+::)?shared_ptr<.*>$', class_type.tag):
return None
method = self._method_dict.get(method_name)
if method is None or not method.enabled:

View file

@ -4,7 +4,7 @@
pkgname=gcc
version=12.2.0
revision=3
revision=4
_minorver="${version%.*}"
_majorver="${_minorver%.*}"
_gmp_version=6.2.1