[PATCH 0/3] Rewrite enum_flags, add unit tests, fix problems

Andrew Burgess andrew.burgess@embecosm.com
Fri Aug 21 15:51:08 GMT 2020


* Pedro Alves <pedro@palves.net> [2020-08-21 15:45:20 +0100]:

> This is an update of a version of this series that I posted back in
> 2016:
> 
>  [PATCH 0/3] enum_flags: Fix problems and add comprehensive unit tests
>  https://sourceware.org/legacy-ml/gdb-patches/2016-11/msg00079.html
> 
> But I never followed thorough with it, leaving it collecting dust on
> my github.  Over the following years, I polished it and tweaked it
> further and extended the unit tests, but never managed to re-submit it
> all upstream.
> 
> Since the subject of enum_flags came up again this week, I thought I'd
> try it again.  This is the result.

Thanks for doing this work.

I've only skimmed through, but it looks good.

Thanks,
Andrew


> 
> Pedro Alves (3):
>   Rewrite valid-expr.h's internals in terms of the detection idiom
>     (C++17/N4502)
>   Use type_instance_flags more throughout
>   Rewrite enum_flags, add unit tests, fix problems
> 
>  gdb/Makefile.in                      |   1 +
>  gdb/btrace.c                         |   4 +-
>  gdb/compile/compile-c-types.c        |   3 +-
>  gdb/compile/compile-cplus-symbols.c  |   4 +-
>  gdb/compile/compile-cplus-types.c    |  10 +-
>  gdb/dwarf2/read.c                    |   7 +-
>  gdb/eval.c                           |   2 +-
>  gdb/gdbarch.c                        |   6 +-
>  gdb/gdbarch.h                        |  12 +-
>  gdb/gdbarch.sh                       |   8 +-
>  gdb/gdbtypes.c                       |  58 ++--
>  gdb/gdbtypes.h                       |  15 +-
>  gdb/go-exp.y                         |   2 +-
>  gdb/record-btrace.c                  |  10 +-
>  gdb/stabsread.c                      |   2 +-
>  gdb/type-stack.c                     |   4 +-
>  gdb/unittests/enum-flags-selftests.c | 586 +++++++++++++++++++++++++++++++++++
>  gdbsupport/enum-flags.h              | 366 +++++++++++++++++-----
>  gdbsupport/traits.h                  |  67 ++++
>  gdbsupport/valid-expr.h              |  35 ++-
>  20 files changed, 1035 insertions(+), 167 deletions(-)
>  create mode 100644 gdb/unittests/enum-flags-selftests.c
> 
> 
> base-commit: b70e516e89d95d06252cb04ded3397ec0a0a3212
> -- 
> 2.14.5
> 


More information about the Gdb-patches mailing list