Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Luis Machado <luis.machado@linaro.org>,
	Pedro Alves <pedro@palves.net>,
	gdb-patches@sourceware.org
Subject: Re: [pushed] gdb: remove TYPE_INSTANCE_FLAGS
Date: Tue, 15 Sep 2020 22:50:24 -0400	[thread overview]
Message-ID: <696a7481-60f0-859c-c0d0-590c6ae69689@simark.ca> (raw)
In-Reply-To: <3db19da5-af04-2f7f-52ed-c496c5b3e791@linaro.org>

On 2020-09-15 5:28 p.m., Luis Machado wrote:
> I think you missed adjusting the stale references in gdb/gdb-gdb.py.in.

I wasn't sure what you meant, but I suppose it is:

115         fields.append("instance_flags = %s"
116                       % TypeFlagsPrinter(self.val['instance_flags']))

? Indeed, instance_flags there should be changed to m_instance_flags.  Does the
patch below look good?


From c99a87806247d5f68a3e4d665dd1abf95b8e77ab Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@efficios.com>
Date: Tue, 15 Sep 2020 22:31:24 -0400
Subject: [PATCH] gdb: update instance_flags field name in gdb-gdb.py.in

Commit 314ad88df63c ("Use type_instance_flags more throughout") changed
the name of field type::instance_flags to type::m_instance_flags.  It
however missed changing it in the gdb-gdb.py.in file, which results in
this when trying to use the pretty-printer:

    (top-gdb) p *val.type
    Traceback (most recent call last):
      File "/home/smarchi/build/binutils-gdb/gdb/gdb-gdb.py", line 116, in to_string
        % TypeFlagsPrinter(self.val['instance_flags']))
      File "/home/smarchi/build/binutils-gdb/gdb/gdb-gdb.py", line 76, in __str__
        flag_list = [flag.short_name for flag in TYPE_FLAGS
      File "/home/smarchi/build/binutils-gdb/gdb/gdb-gdb.py", line 77, in <listcomp>
        if self.val & flag.value]
    gdb.error: Argument to arithmetic operation not a number or boolean.
    $7 =

This patch fixes it.

gdb/ChangeLog:

	* gdb-gdb.py.in (class StructTypePrettyPrinter) <to_string>:
	Change instance_flags to m_instance_flags.

Change-Id: Ib5e03c08fe41ca11cd71998f2b1c58052879ce95
---
 gdb/gdb-gdb.py.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/gdb-gdb.py.in b/gdb/gdb-gdb.py.in
index 594592d4d16..6594ac10b85 100644
--- a/gdb/gdb-gdb.py.in
+++ b/gdb/gdb-gdb.py.in
@@ -113,7 +113,7 @@ class StructTypePrettyPrinter:
         fields.append("reference_type = %s" % self.val['reference_type'])
         fields.append("chain = %s" % self.val['reference_type'])
         fields.append("instance_flags = %s"
-                      % TypeFlagsPrinter(self.val['instance_flags']))
+                      % TypeFlagsPrinter(self.val['m_instance_flags']))
         fields.append("length = %d" % self.val['length'])
         fields.append("main_type = %s" % self.val['main_type'])
         return "\n{" + ",\n ".join(fields) + "}"
-- 
2.28.0



  reply	other threads:[~2020-09-16  2:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 21:31 [pushed v2 0/4] Rewrite enum_flags, add unit tests, fix problems Pedro Alves
2020-09-14 21:31 ` [pushed v2 1/4] Use type_instance_flags more throughout Pedro Alves
2020-09-15  2:28   ` [pushed] gdb: remove TYPE_INSTANCE_FLAGS Simon Marchi
2020-09-15 21:28     ` Luis Machado
2020-09-16  2:50       ` Simon Marchi [this message]
2020-09-16 11:01         ` Pedro Alves
2020-09-16 20:44           ` Simon Marchi
2020-09-14 21:31 ` [pushed v2 2/4] Rename address_space_int_to_name/address_space_name_to_int Pedro Alves
2020-09-14 21:31 ` [pushed v2 3/4] Rewrite valid-expr.h's internals in terms of the detection idiom (C++17/N4502) Pedro Alves
2020-09-17 10:57   ` Vaseeharan Vinayagamoorthy
2020-09-17 11:41     ` Luis Machado
2020-09-17 16:10     ` Vaseeharan Vinayagamoorthy
2020-09-17 16:23       ` Luis Machado
2020-09-14 21:31 ` [pushed v2 4/4] Rewrite enum_flags, add unit tests, fix problems Pedro Alves

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=696a7481-60f0-859c-c0d0-590c6ae69689@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@linaro.org \
    --cc=pedro@palves.net \
    /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