Previously it was not supported to generate both CTF and BTF debug info in the same compiler run, as both formats made incompatible changes to the same internal data structures.
With the structural change in the prior patches, in particular the guarantee that CTF will always be fully emitted before any BTF translation occurs, there is no longer anything preventing generation of both CTF and BTF at the same time. This patch changes option parsing to allow any combination of -gdwarf, -gctf, and -gbtf at the same time. gcc/ * opts.cc (set_debug_level): Allow any combination of -gdwarf, -gctf and -gbtf at the same time. --- gcc/opts.cc | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/gcc/opts.cc b/gcc/opts.cc index f80d5d4ba8f9..d58bea096a5f 100644 --- a/gcc/opts.cc +++ b/gcc/opts.cc @@ -3505,21 +3505,15 @@ set_debug_level (uint32_t dinfo, int extended, const char *arg, } else { - /* Make and retain the choice if both CTF and DWARF debug info are to - be generated. */ - if (((dinfo == DWARF2_DEBUG) || (dinfo == CTF_DEBUG)) + /* Any combination of DWARF, CTF and BTF is allowed together. */ + if (((dinfo == DWARF2_DEBUG) || (dinfo == CTF_DEBUG) + || (dinfo == BTF_DEBUG)) && ((opts->x_write_symbols == (DWARF2_DEBUG|CTF_DEBUG)) + || (opts->x_write_symbols == (DWARF2_DEBUG|BTF_DEBUG)) + || (opts->x_write_symbols == (CTF_DEBUG|BTF_DEBUG)) || (opts->x_write_symbols == DWARF2_DEBUG) - || (opts->x_write_symbols == CTF_DEBUG))) - { - opts->x_write_symbols |= dinfo; - opts_set->x_write_symbols |= dinfo; - } - /* However, CTF and BTF are not allowed together at this time. */ - else if (((dinfo == DWARF2_DEBUG) || (dinfo == BTF_DEBUG)) - && ((opts->x_write_symbols == (DWARF2_DEBUG|BTF_DEBUG)) - || (opts->x_write_symbols == DWARF2_DEBUG) - || (opts->x_write_symbols == BTF_DEBUG))) + || (opts->x_write_symbols == CTF_DEBUG) + || (opts->x_write_symbols == BTF_DEBUG))) { opts->x_write_symbols |= dinfo; opts_set->x_write_symbols |= dinfo; -- 2.43.0