diff options
author | Indu Bhagat <indu.bhagat@oracle.com> | 2021-07-19 10:24:59 -0700 |
---|---|---|
committer | Indu Bhagat <indu.bhagat@oracle.com> | 2021-07-19 10:34:39 -0700 |
commit | f007a638a86e4b59bef0a0d8efa5bb8c5e5b200a (patch) | |
tree | 6ad99d077df3bf835c6cee4f71f724cbaca49996 /gcc/toplev.c | |
parent | 483dd64546f1c7aa6ad8986eee570849d25f15e3 (diff) | |
download | gcc-f007a638a86e4b59bef0a0d8efa5bb8c5e5b200a.zip gcc-f007a638a86e4b59bef0a0d8efa5bb8c5e5b200a.tar.gz gcc-f007a638a86e4b59bef0a0d8efa5bb8c5e5b200a.tar.bz2 |
debug: Allow means for targets to opt out of CTF/BTF support
CTF/BTF debug formats can be safely enabled for all ELF-based targets by
default in GCC.
CTF/BTF debug formats now adopt a similar approach as taken for DWARF debug
format via the DWARF2_DEBUGGING_INFO.
- By default, CTF/BTF formats can be enabled for all ELF-based targets.
- By default, CTF/BTF formats can be disabled for all non ELF-based targets.
- If the user passed a -gctf but CTF is not enabled for the target, GCC
issues an error to the user (as is done currently with other debug formats) -
"target system does not support the 'ctf' debug format". Analogous behavior
for -gbtf command line option.
A previous commit disabled the CTF and BTF testcases on the AIX platform. This
is not necessary now that CTF and BTF debug formats are disabled by default on
all non-ELF targets. GCC emits an error message when -gctf/-gbtf is used on
such platforms and these tests will be skipped.
gcc/
* config/elfos.h (CTF_DEBUGGING_INFO): New definition.
(BTF_DEBUGGING_INFO): Likewise.
* doc/tm.texi.in: Document the new macros.
* doc/tm.texi: Regenerated.
* toplev.c: Guard initialization of debug hooks.
gcc/testsuite/
* gcc.dg/debug/btf/btf.exp: Do not run BTF testsuite if target does not
support BTF format. Remove redundant check for AIX.
* gcc.dg/debug/ctf/ctf.exp: Do not run CTF testsuite if target does not
support CTF format. Remove redundant check for AIX.
* lib/gcc-dg.exp: Remove redundant check for AIX.
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 43f1f7d..14d1335 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1463,8 +1463,15 @@ process_options (void) debug_hooks = &xcoff_debug_hooks; #endif #ifdef DWARF2_DEBUGGING_INFO - else if (dwarf_debuginfo_p () - || dwarf_based_debuginfo_p ()) + else if (dwarf_debuginfo_p ()) + debug_hooks = &dwarf2_debug_hooks; +#endif +#ifdef CTF_DEBUGGING_INFO + else if (ctf_debuginfo_p ()) + debug_hooks = &dwarf2_debug_hooks; +#endif +#ifdef BTF_DEBUGGING_INFO + else if (btf_debuginfo_p ()) debug_hooks = &dwarf2_debug_hooks; #endif #ifdef VMS_DEBUGGING_INFO |