diff options
author | Tom Tromey <tromey@adacore.com> | 2022-10-18 09:48:09 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-10-31 09:04:10 -0600 |
commit | 6c8912c64bcbfd109af0500577409690074e9d27 (patch) | |
tree | 14654b29c15c6417565df7ed635fb7687cb3a5f4 /gdb/gdbarch-components.py | |
parent | 86430497337968e6163aef370c6312e7b5ed6504 (diff) | |
download | binutils-6c8912c64bcbfd109af0500577409690074e9d27.zip binutils-6c8912c64bcbfd109af0500577409690074e9d27.tar.gz binutils-6c8912c64bcbfd109af0500577409690074e9d27.tar.bz2 |
Inline initialization of gdbarch members
This changes gdbarch to use the "predefault" to initialize its members
inline. This required changing a couple of the Value instantiations
to avoid a use of "gdbarch" during initialization, but on the whole I
think this is better -- it removes a hidden ordering dependency.
Diffstat (limited to 'gdb/gdbarch-components.py')
-rw-r--r-- | gdb/gdbarch-components.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/gdbarch-components.py b/gdb/gdbarch-components.py index 46e7565..c997a70 100644 --- a/gdb/gdbarch-components.py +++ b/gdb/gdbarch-components.py @@ -151,7 +151,7 @@ Number of bits in a short or unsigned short for the target machine. invalid=False, ) -Value( +int_bit = Value( comment=""" Number of bits in an int or unsigned int for the target machine. """, @@ -161,7 +161,7 @@ Number of bits in an int or unsigned int for the target machine. invalid=False, ) -Value( +long_bit = Value( comment=""" Number of bits in a long or unsigned long for the target machine. """, @@ -178,7 +178,7 @@ machine. """, type="int", name="long_long_bit", - predefault="2*gdbarch->long_bit", + predefault="2*" + long_bit.predefault, invalid=False, ) @@ -314,7 +314,7 @@ ptr_bit is the size of a pointer on the target """, type="int", name="ptr_bit", - predefault="gdbarch->int_bit", + predefault=int_bit.predefault, invalid=False, ) |