mbox series

[V2,0/2] Fix write_symbols for supporting multiple debug formats

Message ID 1620744003-12647-1-git-send-email-indu.bhagat@oracle.com
Headers show
Series Fix write_symbols for supporting multiple debug formats | expand

Message

Indu Bhagat May 11, 2021, 2:40 p.m. UTC
[Changes from V1]
  - (Addressed Richard's comments)
  - For patch 1/2 [opts: change write_symbols to support bitmasks], use
  debug_set_names more uniformly. Reworded the diagnostics in c-family/c-opts.c
  and c-family/c-pch.c as there can be multiple debug formats. Updated the
  testsuite files accordingly. 
  - Included more backend files for patch 2/2 [dwarf: new dwarf_debuginfo_p
  predicate]
  - Regression tested on x86_64. Open for any suggestions on further testing.
[End of changes from V1]

Hello,

Over the last year, we have discussed and agreed that in order to support
multiple debug formats, we keep DWARF as defacto internal format and any new 
debug format to be supported feeds off DWARF dies. This requirement
specification has worked well for addition for CTF/BTF overall. 

There are some existing issues that need to discussed and fixed in this regard,
though. One of these is the definition and handling of write_symbols.

The current issue is that write_symbols is defined as 

   enum debug_info_type write_symbols = NO_DEBUG;

This means any new combination of debug formats needs to be explicitly
enumerated, like CTF_AND_DWARF2_DEBUG, VMS_AND_DWARF2_DEBUG etc. So the issue
is, to support say, -gctf -gbtf -g or possibly other combination of debug
formats to work together, each one needs to spelled out explicitly; which will
make the handling ugly.

This patch set updates write_symbols to use bitmasks.

Thanks,
Indu Bhagat (2):
  opts: change write_symbols to support bitmasks
  dwarf: new dwarf_debuginfo_p predicate

 gcc/c-family/c-lex.c               |   4 +-
 gcc/c-family/c-opts.c              |   7 ++-
 gcc/c-family/c-pch.c               |  12 ++--
 gcc/common.opt                     |   2 +-
 gcc/config/c6x/c6x.c               |   3 +-
 gcc/config/darwin.c                |   2 +-
 gcc/config/i386/cygming.h          |   2 +-
 gcc/config/i386/darwin.h           |   4 +-
 gcc/config/mips/mips.c             |   2 +-
 gcc/config/rs6000/rs6000.c         |   4 +-
 gcc/dwarf2cfi.c                    |   9 ++-
 gcc/final.c                        |  15 ++---
 gcc/flag-types.h                   |  29 ++++++---
 gcc/flags.h                        |  21 ++++++-
 gcc/objc/objc-act.c                |   2 +-
 gcc/opts.c                         | 117 +++++++++++++++++++++++++++++++++----
 gcc/targhooks.c                    |   2 +-
 gcc/testsuite/gcc.dg/pch/valid-1.c |   2 +-
 gcc/testsuite/lib/dg-pch.exp       |   4 +-
 gcc/toplev.c                       |  15 ++---
 20 files changed, 192 insertions(+), 66 deletions(-)