Fix pretty printer of main_type.flds_bnds.bounds
authorHannes Domani <ssbssa@yahoo.de>
Sat, 2 Jan 2021 16:35:25 +0000 (17:35 +0100)
committerHannes Domani <ssbssa@yahoo.de>
Sat, 2 Jan 2021 18:47:53 +0000 (19:47 +0100)
In struct dynamic_prop the members kind and data were renamed to m_kind and
m_data.

And flag_upper_bound_is_count is actually in bounds directly, not in its
high member.

gdb/ChangeLog:

2021-01-02  Hannes Domani  <ssbssa@yahoo.de>

* gdb-gdb.py.in: Fix main_type.flds_bnds.bounds pretty printer.

gdb/ChangeLog
gdb/gdb-gdb.py.in

index fb8c3c9187850615fa2fc306dd4a44faff695412..6fce234f40fb90a4b8621f907c475e1a6b8e4050 100644 (file)
@@ -1,3 +1,7 @@
+2021-01-02  Hannes Domani  <ssbssa@yahoo.de>
+
+       * gdb-gdb.py.in: Fix main_type.flds_bnds.bounds pretty printer.
+
 2021-01-01  Joel Brobecker  <brobecker@adacore.com>
 
        * gdbarch.sh: Update copyright year range.
index 3f959c7c62fd09fae136fb3ed0dde5394d5d965d..2b1c7ded4b6e343cde7d6f87872a164e2bd8b2d3 100644 (file)
@@ -183,17 +183,18 @@ class StructMainTypePrettyPrinter:
 
     def bound_img(self, bound_name):
         """Return an image of the given main_type's bound."""
-        b = self.val['flds_bnds']['bounds'].dereference()[bound_name]
-        bnd_kind = str(b['kind'])
+        bounds = self.val['flds_bnds']['bounds'].dereference()
+        b = bounds[bound_name]
+        bnd_kind = str(b['m_kind'])
         if bnd_kind == 'PROP_CONST':
-            return str(b['data']['const_val'])
+            return str(b['m_data']['const_val'])
         elif bnd_kind == 'PROP_UNDEFINED':
             return '(undefined)'
         else:
             info = [bnd_kind]
-            if bound_name == 'high' and b['flag_upper_bound_is_count']:
+            if bound_name == 'high' and bounds['flag_upper_bound_is_count']:
                 info.append('upper_bound_is_count')
-            return '{} ({})'.format(str(b['data']['baton']), ','.join(info))
+            return '{} ({})'.format(str(b['m_data']['baton']), ','.join(info))
 
     def bounds_img(self):
         """Return an image of the main_type bounds.