Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [OBV] [PATCH] Fix pretty printer of main_type.flds_bnds.bounds
       [not found] <20210102183852.2029-1-ssbssa.ref@yahoo.de>
@ 2021-01-02 18:38 ` Hannes Domani via Gdb-patches
  2021-01-02 18:43   ` Simon Marchi via Gdb-patches
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Domani via Gdb-patches @ 2021-01-02 18:38 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [OBV] [PATCH] Fix pretty printer of main_type.flds_bnds.bounds
  2021-01-02 18:38 ` [OBV] [PATCH] Fix pretty printer of main_type.flds_bnds.bounds Hannes Domani via Gdb-patches
@ 2021-01-02 18:43   ` Simon Marchi via Gdb-patches
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi via Gdb-patches @ 2021-01-02 18:43 UTC (permalink / raw)
  To: Hannes Domani, gdb-patches

On 2021-01-02 1:38 p.m., Hannes Domani via Gdb-patches wrote:
> 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.

Thanks for doing this.  We don't have any tests exercising these, so I
always forget to update them.

Simon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-02 18:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210102183852.2029-1-ssbssa.ref@yahoo.de>
2021-01-02 18:38 ` [OBV] [PATCH] Fix pretty printer of main_type.flds_bnds.bounds Hannes Domani via Gdb-patches
2021-01-02 18:43   ` Simon Marchi via Gdb-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox