[00/12] More type macros removal

Message ID 20200706133833.145408-1-simon.marchi@polymtl.ca
Headers show
Series
  • More type macros removal
Related show

Message

Kevin Buettner via Gdb-patches July 6, 2020, 1:38 p.m.
Here is the next installment of removal of type macros, in favor of
getter/setter methods.

I added some assertions in some of these methods, to verify that the
method is called on a type with the expected code (this is one of the
goal of these changes).  It found one case that needed to be fixed,
handled by patch 3.

The rest should be relatively straightforward.

Simon Marchi (12):
  gdb: add type::bounds / type::set_bounds
  gdb: remove TYPE_RANGE_DATA macro
  gdb: make get_discrete_bounds check for non-constant range bounds
  gdb: add accessors to struct dynamic_prop
  gdb: remove TYPE_HIGH_BOUND and TYPE_LOW_BOUND
  gdb: remove TYPE_LOW_BOUND_UNDEFINED and TYPE_HIGH_BOUND_UNDEFINED
  gdb: remove TYPE_LOW_BOUND_KIND and TYPE_HIGH_BOUND_KIND
  gdb: remove TYPE_ARRAY_{UPPER,LOWER}_BOUND_IS_UNDEFINED
  gdb: remove TYPE_ARRAY_{LOWER,UPPER}_BOUND_VALUE
  gdb: remove TYPE_BIT_STRIDE
  gdb: remove TYPE_ARRAY_BIT_STRIDE
  gdb: make type::bounds work for array and string types

 gdb/ada-lang.c                    |  22 ++--
 gdb/ada-tasks.c                   |   7 +-
 gdb/ada-typeprint.c               |   8 +-
 gdb/ada-valprint.c                |   2 +-
 gdb/c-typeprint.c                 |   4 +-
 gdb/c-varobj.c                    |  18 ++-
 gdb/compile/compile-c-symbols.c   |   6 +-
 gdb/compile/compile-c-types.c     |  10 +-
 gdb/compile/compile-cplus-types.c |  10 +-
 gdb/ctfread.c                     |   2 +-
 gdb/dwarf2/loc.c                  |  16 +--
 gdb/dwarf2/read.c                 |  71 +++++-------
 gdb/eval.c                        |   8 +-
 gdb/f-typeprint.c                 |   4 +-
 gdb/f-valprint.c                  |  10 +-
 gdb/gdbtypes.c                    | 186 +++++++++++++-----------------
 gdb/gdbtypes.h                    | 162 +++++++++++++++++++-------
 gdb/gnu-v3-abi.c                  |   3 +-
 gdb/guile/scm-type.c              |   7 +-
 gdb/m2-typeprint.c                |  20 ++--
 gdb/m2-valprint.c                 |   4 +-
 gdb/mdebugread.c                  |   8 +-
 gdb/p-typeprint.c                 |  10 +-
 gdb/p-valprint.c                  |   2 +-
 gdb/printcmd.c                    |   3 +-
 gdb/python/py-type.c              |   7 +-
 gdb/rust-lang.c                   |   8 +-
 gdb/type-stack.c                  |   3 +-
 gdb/valarith.c                    |  11 +-
 gdb/valops.c                      |   2 +-
 gdb/value.c                       |   4 +-
 31 files changed, 337 insertions(+), 301 deletions(-)

-- 
2.27.0

Comments

Kevin Buettner via Gdb-patches July 6, 2020, 1:50 p.m. | #1
On 2020-07-06 9:38 a.m., Simon Marchi wrote:
> Here is the next installment of removal of type macros, in favor of

> getter/setter methods.

> 

> I added some assertions in some of these methods, to verify that the

> method is called on a type with the expected code (this is one of the

> goal of these changes).  It found one case that needed to be fixed,

> handled by patch 3.

> 

> The rest should be relatively straightforward.

> 

> Simon Marchi (12):

>   gdb: add type::bounds / type::set_bounds

>   gdb: remove TYPE_RANGE_DATA macro

>   gdb: make get_discrete_bounds check for non-constant range bounds

>   gdb: add accessors to struct dynamic_prop

>   gdb: remove TYPE_HIGH_BOUND and TYPE_LOW_BOUND

>   gdb: remove TYPE_LOW_BOUND_UNDEFINED and TYPE_HIGH_BOUND_UNDEFINED

>   gdb: remove TYPE_LOW_BOUND_KIND and TYPE_HIGH_BOUND_KIND

>   gdb: remove TYPE_ARRAY_{UPPER,LOWER}_BOUND_IS_UNDEFINED

>   gdb: remove TYPE_ARRAY_{LOWER,UPPER}_BOUND_VALUE

>   gdb: remove TYPE_BIT_STRIDE

>   gdb: remove TYPE_ARRAY_BIT_STRIDE

>   gdb: make type::bounds work for array and string types


Arf, I had to send this series in two shots, because my SMTP doesn't allow
sending more than 10 messages in one go.  And I forgot to link the second
batch with the first one using the Message-Id.  Here they are, just in case:

10: https://sourceware.org/pipermail/gdb-patches/2020-July/170191.html
11: https://sourceware.org/pipermail/gdb-patches/2020-July/170190.html
12: https://sourceware.org/pipermail/gdb-patches/2020-July/170192.html

Simon
Tom Tromey July 11, 2020, 10:27 p.m. | #2
>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:


Simon> Arf, I had to send this series in two shots, because my SMTP doesn't allow
Simon> sending more than 10 messages in one go.  And I forgot to link the second
Simon> batch with the first one using the Message-Id.

FWIW I have this problem and I use git send-email --batch-size to work
around it.

Tom
Kevin Buettner via Gdb-patches July 11, 2020, 11:05 p.m. | #3
On 2020-07-11 6:27 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

> 

> Simon> Arf, I had to send this series in two shots, because my SMTP doesn't allow

> Simon> sending more than 10 messages in one go.  And I forgot to link the second

> Simon> batch with the first one using the Message-Id.

> 

> FWIW I have this problem and I use git send-email --batch-size to work

> around it.

> 

> Tom

> 


Awesome, thanks for the tip!

Simon
Kevin Buettner via Gdb-patches July 13, 2020, 3:15 a.m. | #4
On 2020-07-06 9:38 a.m., Simon Marchi wrote:
> Here is the next installment of removal of type macros, in favor of

> getter/setter methods.

> 

> I added some assertions in some of these methods, to verify that the

> method is called on a type with the expected code (this is one of the

> goal of these changes).  It found one case that needed to be fixed,

> handled by patch 3.

> 

> The rest should be relatively straightforward.

> 

> Simon Marchi (12):

>   gdb: add type::bounds / type::set_bounds

>   gdb: remove TYPE_RANGE_DATA macro

>   gdb: make get_discrete_bounds check for non-constant range bounds

>   gdb: add accessors to struct dynamic_prop

>   gdb: remove TYPE_HIGH_BOUND and TYPE_LOW_BOUND

>   gdb: remove TYPE_LOW_BOUND_UNDEFINED and TYPE_HIGH_BOUND_UNDEFINED

>   gdb: remove TYPE_LOW_BOUND_KIND and TYPE_HIGH_BOUND_KIND

>   gdb: remove TYPE_ARRAY_{UPPER,LOWER}_BOUND_IS_UNDEFINED

>   gdb: remove TYPE_ARRAY_{LOWER,UPPER}_BOUND_VALUE

>   gdb: remove TYPE_BIT_STRIDE

>   gdb: remove TYPE_ARRAY_BIT_STRIDE

>   gdb: make type::bounds work for array and string types

> 

>  gdb/ada-lang.c                    |  22 ++--

>  gdb/ada-tasks.c                   |   7 +-

>  gdb/ada-typeprint.c               |   8 +-

>  gdb/ada-valprint.c                |   2 +-

>  gdb/c-typeprint.c                 |   4 +-

>  gdb/c-varobj.c                    |  18 ++-

>  gdb/compile/compile-c-symbols.c   |   6 +-

>  gdb/compile/compile-c-types.c     |  10 +-

>  gdb/compile/compile-cplus-types.c |  10 +-

>  gdb/ctfread.c                     |   2 +-

>  gdb/dwarf2/loc.c                  |  16 +--

>  gdb/dwarf2/read.c                 |  71 +++++-------

>  gdb/eval.c                        |   8 +-

>  gdb/f-typeprint.c                 |   4 +-

>  gdb/f-valprint.c                  |  10 +-

>  gdb/gdbtypes.c                    | 186 +++++++++++++-----------------

>  gdb/gdbtypes.h                    | 162 +++++++++++++++++++-------

>  gdb/gnu-v3-abi.c                  |   3 +-

>  gdb/guile/scm-type.c              |   7 +-

>  gdb/m2-typeprint.c                |  20 ++--

>  gdb/m2-valprint.c                 |   4 +-

>  gdb/mdebugread.c                  |   8 +-

>  gdb/p-typeprint.c                 |  10 +-

>  gdb/p-valprint.c                  |   2 +-

>  gdb/printcmd.c                    |   3 +-

>  gdb/python/py-type.c              |   7 +-

>  gdb/rust-lang.c                   |   8 +-

>  gdb/type-stack.c                  |   3 +-

>  gdb/valarith.c                    |  11 +-

>  gdb/valops.c                      |   2 +-

>  gdb/value.c                       |   4 +-

>  31 files changed, 337 insertions(+), 301 deletions(-)

> 

> -- 

> 2.27.0

> 


I pushed this.

Simon