Hello,

Over the last year, we have discussed and agreed that in order to support
multiple debug formats, we keep DWARF as the default internal debug format; 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,
however. One of them 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 to support
say, "-gctf -gbtf -g" or to make other combinations of debug formats possible,
each one needs to spelled out explicitly; this will make the handling ugly.

We discussed over IRC about the possibility of write_symbols to use bitmasks
instead. Please take a look at the patch set and let me know what you think.

BTW, the patch 2/2 [dwarf: new dwarf_debuginfo_p predicate] in this series is
the same as the one sent earlier in the CTF patch series (and has been
approved). I just include it in this patch series as it fits better here.

In a subsequent patch after these current two patches, I can work on removing
the VMS_AND_DWARF2_DEBUG symbol and replacing its usages with the appropriate
bitmasks. I would also like to review the usages of debug_type_names [] in code
diagnostics around PCH (in c-family/c-opts.c and c-family/c-pch.c) in terms of
what combination of debug formats would be allowed and such. But at this
time, the patch retains the current behaviour by simply adjusting the approach
to access the debug_type_name [].

Boostrapped and regression tested on x86_64.

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 |  10 +++--
 gcc/c-family/c-pch.c  |  12 +++---
 gcc/common.opt        |   2 +-
 gcc/config/c6x/c6x.c  |   3 +-
 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/toplev.c          |  15 ++++---
 13 files changed, 186 insertions(+), 55 deletions(-)

-- 
1.8.3.1

Reply via email to