Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hannes Domani via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [OBV] [PATCH] Fix pretty printer of main_type.flds_bnds.bounds
Date: Sat,  2 Jan 2021 19:38:52 +0100	[thread overview]
Message-ID: <20210102183852.2029-1-ssbssa@yahoo.de> (raw)
In-Reply-To: <20210102183852.2029-1-ssbssa.ref@yahoo.de>

I will push this under the obvious rule.


In struct dynamic_prop the members kind and data were rename 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/gdb-gdb.py.in | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/gdb/gdb-gdb.py.in b/gdb/gdb-gdb.py.in
index 3f959c7c62f..2b1c7ded4b6 100644
--- a/gdb/gdb-gdb.py.in
+++ b/gdb/gdb-gdb.py.in
@@ -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.
-- 
2.29.2


       reply	other threads:[~2021-01-02 18:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210102183852.2029-1-ssbssa.ref@yahoo.de>
2021-01-02 18:38 ` Hannes Domani via Gdb-patches [this message]
2021-01-02 18:43   ` Simon Marchi via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210102183852.2029-1-ssbssa@yahoo.de \
    --to=gdb-patches@sourceware.org \
    --cc=ssbssa@yahoo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox