aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorLawrence Crowl <crowl@google.com>2007-04-17 06:19:36 +0000
committerIan Lance Taylor <iant@google.com>2007-04-17 06:19:36 +0000
commit553e6afd26135070fd54a0cfa93728197edccff9 (patch)
tree4e1b0eb361d1ad81f81cf74c4941675abea36a99 /gcc/doc
parent8e5ce5e3a405e833ee6c0a9bec4910fa8353292e (diff)
./:
* doc/invoke.texi (Debugging Options): Add documentation for the -femit-struct-debug options -femit-struct-debug-baseonly, -femit-struct-debug-reduced, and -femit-struct-debug-detailed[=...]. * c-opts.c (c_common_handle_option): Add OPT_femit_struct_debug_baseonly, OPT_femit_struct_debug_reduced, and OPT_femit_struct_debug_detailed_. * c.opt: Add specifications for -femit-struct-debug-baseonly, -femit-struct-debug-reduced, and -femit-struct-debug-detailed[=...]. * opts.c (set_struct_debug_option): Parse the -femit-struct-debug-... options. * opts.c (matches_main_base, main_input_basename, main_input_baselength, base_of_path, matches_main_base): Add variables and functions to compare header base name to compilation unit base name. * opts.c (should_emit_struct_debug): Add to determine to emit a structure based on the option. (dump_struct_debug) Also disabled function to debug this function. * opts.c (handle_options): Save the base name of the compilation unit. * langhooks-def.h (LANG_HOOKS_GENERIC_TYPE_P): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Add. This hook indicates if a type is generic. Set it by default to "never generic". * langhooks.h (struct lang_hooks_for_types): Add a new hook to determine if a struct type is generic or not. * cp/cp-tree.h (class_tmpl_impl_spec_p): Declare a C++ hook. * cp/tree.c (class_tmpl_impl_spec_p): Implement the C++ hook. * cp/cp-lang.c (LANG_HOOKS_GENERIC_TYPE_P): Override null C hook with live C++ hook. * flags.h (enum debug_info_usage): Add an enumeration to describe a program's use of a structure type. * dwarf2out.c (gen_struct_or_union_type_die): Add a new parameter to indicate the program's usage of the type. Filter structs based on the -femit-struct-debug-... specification. (gen_type_die): Split into two routines, gen_type_die and gen_type_die_with_usage. gen_type_die is now a wrapper that assumes direct usage. (gen_type_die_with_usage): Replace calls to gen_type_die with gen_type_die_with_usage adding the program usage of the referenced type. (dwarf2out_imported_module_or_decl): Suppress struct debug information using should_emit_struct_debug when appropriate. testsuite/: * g++.dg/other/fesd-any.C: Test -femit-struct-debug-detailed=any. * g++.dg/other/fesd-any.h: Test -femit-struct-debug-detailed=any. * g++.dg/other/fesd-baseonly.C: Test -femit-struct-debug-baseonly. * g++.dg/other/fesd-baseonly.h: Test -femit-struct-debug-baseonly. * g++.dg/other/fesd-none.C: Test -femit-struct-debug-detailed=none. * g++.dg/other/fesd-none.h: Test -femit-struct-debug-detailed=none. * g++.dg/other/fesd-reduced.C: Test -femit-struct-debug-reduced. * g++.dg/other/fesd-reduced.h: Test -femit-struct-debug-reduced. * g++.dg/other/fesd-sys.C: Test -femit-struct-debug-detailed=sys. * g++.dg/other/fesd-sys.h: Test -femit-struct-debug-detailed=sys. * g++.dg/other/fesd.h: Common to -femit-struct-debug-... tests. * gcc.dg/fesd-any.c: Test -femit-struct-debug-detailed=any. * gcc.dg/fesd-any.h: Test -femit-struct-debug-detailed=any. * gcc.dg/fesd-baseonly.c: Test -femit-struct-debug-baseonly. * gcc.dg/fesd-baseonly.h: Test -femit-struct-debug-baseonly. * gcc.dg/fesd-none.c: Test -femit-struct-debug-detailed=none. * gcc.dg/fesd-none.h: Test -femit-struct-debug-detailed=none. * gcc.dg/fesd-reduced.c: Test -femit-struct-debug-reduced. * gcc.dg/fesd-reduced.h: Test -femit-struct-debug-reduced. * gcc.dg/fesd-sys.c: Test -femit-struct-debug-detailed=sys. * gcc.dg/fesd-sys.h: Test -femit-struct-debug-detailed=sys. * gcc.dg/fesd.h: Common to -femit-struct-debug-... tests. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@123909 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/invoke.texi74
1 files changed, 74 insertions, 0 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 842dcbfcbce..d1523db29de 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -300,6 +300,8 @@ Objective-C and Objective-C++ Dialects}.
-ftest-coverage -ftime-report -fvar-tracking @gol
-g -g@var{level} -gcoff -gdwarf-2 @gol
-ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+ @gol
+-femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
+-femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
-p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol
-print-multi-directory -print-multi-lib @gol
-print-prog-name=@var{program} -print-search-dirs -Q @gol
@@ -3967,6 +3969,78 @@ Compress DWARF2 debugging information by eliminating duplicated
information about each symbol. This option only makes sense when
generating DWARF2 debugging information with @option{-gdwarf-2}.
+@item -femit-struct-debug-baseonly
+Emit debug information for struct-like types
+only when the base name of the compilation source file
+matches the base name of file in which the struct was defined.
+
+This option substantially reduces the size of debugging information,
+but at significant potential loss in type information to the debugger.
+See @option{-femit-struct-debug-reduced} for a less aggressive option.
+See @option{-femit-struct-debug-detailed} for more detailed control.
+
+This option works only with DWARF 2.
+
+@item -femit-struct-debug-reduced
+Emit debug information for struct-like types
+only when the base name of the compilation source file
+matches the base name of file in which the type was defined,
+unless the struct is a template or defined in a system header.
+
+This option significantly reduces the size of debugging information,
+with some potential loss in type information to the debugger.
+See @option{-femit-struct-debug-baseonly} for a more aggressive option.
+See @option{-femit-struct-debug-detailed} for more detailed control.
+
+This option works only with DWARF 2.
+
+@item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
+Specify the struct-like types
+for which the compiler will generate debug information.
+The intent is to reduce duplicate struct debug information
+between different object files within the same program.
+
+This option is a detailed version of
+@option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
+which will serve for most needs.
+
+A specification has the syntax
+[@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
+
+The optional first word limits the specification to
+structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
+A struct type is used directly when it is the type of a variable, member.
+Indirect uses arise through pointers to structs.
+That is, when use of an incomplete struct would be legal, the use is indirect.
+An example is
+@samp{struct one direct; struct two * indirect;}.
+
+The optional second word limits the specification to
+ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
+Generic structs are a bit complicated to explain.
+For C++, these are non-explicit specializations of template classes,
+or non-template classes within the above.
+Other programming languages have generics,
+but @samp{-femit-struct-debug-detailed} does not yet implement them.
+
+The third word specifies the source files for those
+structs for which the compiler will emit debug information.
+The values @samp{none} and @samp{any} have the normal meaning.
+The value @samp{base} means that
+the base of name of the file in which the type declaration appears
+must match the base of the name of the main compilation file.
+In practice, this means that
+types declared in @file{foo.c} and @file{foo.h} will have debug information,
+but types declared in other header will not.
+The value @samp{sys} means those types satisfying @samp{base}
+or declared in system or compiler headers.
+
+You may need to experiment to determine the best settings for your application.
+
+The default is @samp{-femit-struct-debug-detailed=all}.
+
+This option works only with DWARF 2.
+
@cindex @command{prof}
@item -p
@opindex p