@@ -936,6 +936,21 @@ c_common_post_options (const char **pfilename)
#endif
}
+ /* The -fforce-dwarf-lexical-blocks option is only relevant when debug
+ info is in DWARF4 format. */
+ if (flag_force_dwarf_blocks)
+ {
+ if (write_symbols != DWARF2_DEBUG)
+ flag_force_dwarf_blocks = 0;
+ if (write_symbols == DWARF2_DEBUG && dwarf_version < 4)
+ {
+ inform (input_location,
+ "-fforce-dwarf-lexical-blocks is only supported with "
+ "DWARF4 debug format");
+ flag_force_dwarf_blocks = 0;
+ }
+ }
+
if (flag_preprocess_only)
{
/* Open the output now. We must do so even if flag_no_output is
@@ -960,6 +960,10 @@ ffor-scope
C++ ObjC++ Var(flag_new_for_scope) Init(1)
Scope of for-init-statement variables is local to the loop
+fforce-dwarf-lexical-blocks
+C C++ Var(flag_force_dwarf_blocks)
+Force generation of lexical blocks in DWARF output
+
ffreestanding
C ObjC C++ ObjC++
Do not assume that standard C libraries and \"main\" exist
@@ -333,6 +333,7 @@ Objective-C and Objective-C++ Dialects}.
-feliminate-unused-debug-symbols -femit-class-debug-always @gol
-fenable-@var{kind}-@var{pass} @gol
-fenable-@var{kind}-@var{pass}=@var{range-list} @gol
+-fforce-dwarf-lexical-blocks @gol
-fdebug-types-section -fmem-report-wpa @gol
-fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
-fopt-info @gol
@@ -5200,6 +5201,17 @@ normally emits debugging information for classes because using this
option increases the size of debugging information by as much as a
factor of two.
+@item -fforce-dwarf-lexical-blocks
+Produce debug information (a DW_TAG_lexical_block) for every function
+body, loop body, @code{switch} body, @code{case} statement, @code{if} and
+@code{else} statement, even if the body is a single statement. Likewise, a
+lexical block will be emitted for the first label of a statement. This block
+ends at the end of the current lexical scope, or when a @code{break},
+@code{continue}, @code{goto} or @code{return} statement is encountered at the
+same lexical scope level. This option is useful for coverage tools that
+utilize the DWARF debug information. This option only applies to C/C++ code
+and is available when using DWARF Version 4 or higher.
+
@item -fdebug-types-section
@opindex fdebug-types-section
@opindex fno-debug-types-section