public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: gdbarch.py: remove Info.__init__
@ 2023-02-27 18:29 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2023-02-27 18:29 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fbbe9eb8b51e98d57cf243a109cfc57eb9bfbeeb

commit fbbe9eb8b51e98d57cf243a109cfc57eb9bfbeeb
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date:   Sun Feb 26 20:13:57 2023 -0500

    gdb: gdbarch.py: remove Info.__init__
    
    Info.__init__ currently assigns `self.predicate = None`.  This was
    helpful to ensure that all component types had a `predicate` attribute.
    The generator code could then avoid having code like "if the component
    is anything but Info, use predicate".  Since the previous commit, all
    component types have a predicate attribute which defaults to False.  We
    can therefore remove the assignment in Info.__init__, and in turn remove
    Info.__init__.  We however need to make the printer parameter of
    _Component.__init__ optional, as Info don't need a printer.
    
    Change-Id: I611edeca9cc9837eb49dddfe038595e1ff3b7239
    Reviewed-By: Andrew Burgess <aburgess@redhat.com>

Diff:
---
 gdb/gdbarch.py | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/gdb/gdbarch.py b/gdb/gdbarch.py
index 63c3aee1dc0..f97f39b6db0 100755
--- a/gdb/gdbarch.py
+++ b/gdb/gdbarch.py
@@ -53,7 +53,7 @@ class _Component:
         self,
         name,
         type,
-        printer,
+        printer=None,
         comment=None,
         predicate=False,
         predefault=None,
@@ -97,11 +97,6 @@ class _Component:
 class Info(_Component):
     "An Info component is copied from the gdbarch_info."
 
-    def __init__(self, *, name, type, printer=None):
-        super().__init__(name=name, type=type, printer=printer)
-        # This little hack makes the generator a bit simpler.
-        self.predicate = None
-
 
 class Value(_Component):
     "A Value component is just a data member."

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-27 18:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 18:29 [binutils-gdb] gdb: gdbarch.py: remove Info.__init__ Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).