@@ -125,6 +125,11 @@ enum debug_info_levels debug_info_level = DINFO_LEVEL_NONE
Variable
bool use_gnu_debug_info_extensions
+; Level of CTF debugging information we are producing. See flag-types.h
+; for the definitions of the different possible levels.
+Variable
+enum ctf_debug_info_levels ctf_debug_info_level = CTFINFO_LEVEL_NONE
+
; Original value of maximum field alignment in bytes, specified via
; -fpack-struct=<value>.
Variable
@@ -2995,6 +3000,10 @@ gcolumn-info
Common Driver Var(debug_column_info,1) Init(1)
Record DW_AT_decl_column and DW_AT_call_column in DWARF.
+gt
+Common Driver RejectNegative JoinedOrMissing
+Generate CTF debug information at default level.
+
gdwarf
Common Driver JoinedOrMissing Negative(gdwarf-)
Generate debug information in default version of DWARF format.
@@ -374,6 +374,7 @@ Objective-C and Objective-C++ Dialects}.
@item Debugging Options
@xref{Debugging Options,,Options for Debugging Your Program}.
@gccoptlist{-g -g@var{level} -gdwarf -gdwarf-@var{version} @gol
+-gt -gt@var{level} @gol
-ggdb -grecord-gcc-switches -gno-record-gcc-switches @gol
-gstabs -gstabs+ -gstrict-dwarf -gno-strict-dwarf @gol
-gas-loc-support -gno-as-loc-support @gol
@@ -7784,6 +7785,21 @@ other DWARF-related options such as
@option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
in their names, but apply to all currently-supported versions of DWARF.
+@item -gt
+@itemx -gt@var{level}
+@opindex gt
+Request CTF debug information and use level to specify how much CTF debug
+information should be produced. If -gt is specified without a value for level,
+the default level of CTF debug information is 2.
+
+Level 0 produces no CTF debug information at all. Thus, -gt0 negates -gt.
+
+Level 1 produces CTF information for tracebacks only. This includes callsite
+information, but does not include type information.
+
+Level 2 produces type information for entities (functions, data objects etc.)
+at file-scope or global-scope only.
+
@item -gstabs
@opindex gstabs
Produce debugging information in stabs format (if that is supported),
@@ -105,6 +105,19 @@ enum dwarf_gnat_encodings
Emit GNAT encodings for the rest. */
};
+/* CTF debug info levels.
+ CTF debug info levels are untied with DWARF debug info levels because CTF
+ may co-exist with DWARF. */
+enum ctf_debug_info_levels
+{
+ CTFINFO_LEVEL_NONE = 0, /* Write no CTF debug info. */
+ CTFINFO_LEVEL_TERSE = 1, /* Write CTF information to support tracebacks
+ only. Not Implemented. */
+ CTFINFO_LEVEL_NORMAL = 2 /* Write CTF type information for all entities
+ (functions, data objects, variables etc.)
+ at file-scope or global-scope only. */
+};
+
/* Enumerate Objective-c instance variable visibility settings. */
enum ivar_visibility
@@ -195,6 +195,8 @@ static void set_debug_level (enum debug_info_type type, int extended,
const char *arg, struct gcc_options *opts,
struct gcc_options *opts_set,
location_t loc);
+static void set_ctf_debug_level (const char *arg,
+ struct gcc_options *opts, location_t loc);
static void set_fast_math_flags (struct gcc_options *opts, int set);
static void decode_d_option (const char *arg, struct gcc_options *opts,
location_t loc, diagnostic_context *dc);
@@ -2683,6 +2685,10 @@ common_handle_option (struct gcc_options *opts,
opts->x_flag_stack_usage_info = value != 0;
break;
+ case OPT_gt:
+ set_ctf_debug_level (arg, opts, loc);
+ break;
+
case OPT_g:
set_debug_level (NO_DEBUG, DEFAULT_GDB_EXTENSIONS, arg, opts, opts_set,
loc);
@@ -3005,6 +3011,26 @@ set_debug_level (enum debug_info_type type, int extended, const char *arg,
}
}
+/* Handle a debug output -gt switch for options OPTS. */
+static void
+set_ctf_debug_level (const char *arg,
+ struct gcc_options *opts, location_t loc)
+{
+ /* CTF debug flag without a level defaults to level 2. */
+ if (*arg == '\0')
+ opts->x_ctf_debug_info_level = CTFINFO_LEVEL_NORMAL;
+ else
+ {
+ int argval = integral_argument (arg);
+ if (argval == -1)
+ error_at (loc, "unrecognized ctf debug output level %qs", arg);
+ else if (argval > CTFINFO_LEVEL_NORMAL)
+ error_at (loc, "ctf debug output level %qs is too high", arg);
+ else
+ opts->x_ctf_debug_info_level = (enum ctf_debug_info_levels) argval;
+ }
+}
+
/* Arrange to dump core on error for diagnostic context DC. (The
regular error message is still printed first, except in the case of
abort ().) */