diff mbox

[06/12] always define DWARF2_DEBUGGING_INFO

Message ID 1447087669-14039-7-git-send-email-tbsaunde+gcc@tbsaunde.org
State New
Headers show

Commit Message

tbsaunde+gcc@tbsaunde.org Nov. 9, 2015, 4:47 p.m. UTC
From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2015-11-09  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/arc/arc.h: Define DWARF2_DEBUGGING_INFO to 1.
	* config/microblaze/microblaze.h: Likewise.
	* defaults.h (DWARF2_DEBUGGING_INFO): New default definition.
	* doc/tm.texi: Regenerate.
	* doc/tm.texi.in: Adjust.
	* dwarf2out.c (dwarf2out_begin_prologue): Likewise.
	(output_loc_operands): Likewise.
	* gcc.c: Likewise.
	* opts.c (set_debug_level): Likewise.
	* targhooks.c (default_debug_unwind_info): Likewise.
	* toplev.c (compile_file): Likewise.
	(process_options): Likewise.
---
 gcc/config/arc/arc.h               | 2 +-
 gcc/config/microblaze/microblaze.h | 2 +-
 gcc/defaults.h                     | 8 ++++++--
 gcc/doc/tm.texi                    | 2 +-
 gcc/doc/tm.texi.in                 | 2 +-
 gcc/dwarf2out.c                    | 6 +++---
 gcc/gcc.c                          | 4 ++--
 gcc/opts.c                         | 2 +-
 gcc/targhooks.c                    | 6 +++---
 gcc/toplev.c                       | 6 ++----
 10 files changed, 21 insertions(+), 19 deletions(-)
diff mbox

Patch

diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index e8baf5b..cb98bda 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -1446,7 +1446,7 @@  extern int arc_return_address_regs[4];
 #ifdef DWARF2_DEBUGGING_INFO
 #undef DWARF2_DEBUGGING_INFO
 #endif
-#define DWARF2_DEBUGGING_INFO
+#define DWARF2_DEBUGGING_INFO 1
 
 /* Prefer STABS (for now).  */
 #undef PREFERRED_DEBUGGING_TYPE
diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
index 482c4a2..fbe4761 100644
--- a/gcc/config/microblaze/microblaze.h
+++ b/gcc/config/microblaze/microblaze.h
@@ -185,7 +185,7 @@  extern enum pipeline_type microblaze_pipe;
   gen_rtx_REG (VOIDmode, GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM)
 
 /* Use DWARF 2 debugging information by default.  */
-#define DWARF2_DEBUGGING_INFO
+#define DWARF2_DEBUGGING_INFO 1
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 
 /* Target machine storage layout */
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 0de7899..dddf796 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -918,6 +918,10 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define SDB_DEBUGGING_INFO 0
 #endif
 
+#ifndef DWARF2_DEBUGGING_INFO
+#define DWARF2_DEBUGGING_INFO 0
+#endif
+
 #ifndef XCOFF_DEBUGGING_INFO
 #define XCOFF_DEBUGGING_INFO 0
 #endif
@@ -930,7 +934,7 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    PREFERRED_DEBUGGING_TYPE to choose the default.  */
 
 #if 1 < (defined (DBX_DEBUGGING_INFO) + (SDB_DEBUGGING_INFO) \
-	 + defined (DWARF2_DEBUGGING_INFO) + (XCOFF_DEBUGGING_INFO) \
+	 + (DWARF2_DEBUGGING_INFO) + (XCOFF_DEBUGGING_INFO) \
 	 + (VMS_DEBUGGING_INFO))
 #ifndef PREFERRED_DEBUGGING_TYPE
 #error You must define PREFERRED_DEBUGGING_TYPE
@@ -944,7 +948,7 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #elif SDB_DEBUGGING_INFO
 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
 
-#elif defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
+#elif DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 
 #elif VMS_DEBUGGING_INFO
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index b3b684a..88c89be 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -9572,7 +9572,7 @@  for SDB in response to the @option{-g} option.
 @end defmac
 
 @defmac DWARF2_DEBUGGING_INFO
-Define this macro if GCC should produce dwarf version 2 format
+Define this macro to 1 if GCC should produce dwarf version 2 format
 debugging output in response to the @option{-g} option.
 
 @deftypefn {Target Hook} int TARGET_DWARF_CALLING_CONVENTION (const_tree @var{function})
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 0f0a4f2..4b46a45 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -6997,7 +6997,7 @@  for SDB in response to the @option{-g} option.
 @end defmac
 
 @defmac DWARF2_DEBUGGING_INFO
-Define this macro if GCC should produce dwarf version 2 format
+Define this macro to 1 if GCC should produce dwarf version 2 format
 debugging output in response to the @option{-g} option.
 
 @hook TARGET_DWARF_CALLING_CONVENTION
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 88c931c..cb6acc6 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1075,7 +1075,7 @@  dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
 
   /* We only want to output line number information for the genuine dwarf2
      prologue case, not the eh frame case.  */
-#ifdef DWARF2_DEBUGGING_INFO
+#if DWARF2_DEBUGGING_INFO
   if (file)
     dwarf2out_source_line (line, file, 0, true);
 #endif
@@ -1755,7 +1755,7 @@  output_loc_operands (dw_loc_descr_ref loc, int for_eh_or_skip)
 
   switch (loc->dw_loc_opc)
     {
-#ifdef DWARF2_DEBUGGING_INFO
+#if DWARF2_DEBUGGING_INFO
     case DW_OP_const2u:
     case DW_OP_const2s:
       dw2_asm_output_data (2, val1->v.val_int, NULL);
@@ -1983,7 +1983,7 @@  output_loc_operands (dw_loc_descr_ref loc, int for_eh_or_skip)
 	}
       else
 	{
-#ifdef DWARF2_DEBUGGING_INFO
+#if DWARF2_DEBUGGING_INFO
 	  dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE, val1->v.val_addr, NULL);
 #else
 	  gcc_unreachable ();
diff --git a/gcc/gcc.c b/gcc/gcc.c
index bbc9b23..2600b83 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -828,7 +828,7 @@  proper position among the other output files.  */
 /* Define ASM_DEBUG_SPEC to be a spec suitable for translating '-g'
    to the assembler.  */
 #ifndef ASM_DEBUG_SPEC
-# if defined(DBX_DEBUGGING_INFO) && defined(DWARF2_DEBUGGING_INFO) \
+# if defined(DBX_DEBUGGING_INFO) && (DWARF2_DEBUGGING_INFO) \
      && defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
 #  define ASM_DEBUG_SPEC						\
       (PREFERRED_DEBUGGING_TYPE == DBX_DEBUG				\
@@ -838,7 +838,7 @@  proper position among the other output files.  */
 #  if defined(DBX_DEBUGGING_INFO) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
 #   define ASM_DEBUG_SPEC "%{g*:%{!g0:--gstabs}}" ASM_MAP
 #  endif
-#  if defined(DWARF2_DEBUGGING_INFO) && defined(HAVE_AS_GDWARF2_DEBUG_FLAG)
+#  if (DWARF2_DEBUGGING_INFO) && defined(HAVE_AS_GDWARF2_DEBUG_FLAG)
 #   define ASM_DEBUG_SPEC "%{g*:%{!g0:--gdwarf2}}" ASM_MAP
 #  endif
 # endif
diff --git a/gcc/opts.c b/gcc/opts.c
index 9a3fbb3..1ae7d75 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -2287,7 +2287,7 @@  set_debug_level (enum debug_info_type type, int extended, const char *arg,
 
 	  if (extended == 2)
 	    {
-#if defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
+#if DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
 	      opts->x_write_symbols = DWARF2_DEBUG;
 #elif defined DBX_DEBUGGING_INFO
 	      opts->x_write_symbols = DBX_DEBUG;
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index c34b4e9..a75cbc3 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -1568,10 +1568,10 @@  default_debug_unwind_info (void)
 #endif
 
   /* Otherwise, only turn it on if dwarf2 debugging is enabled.  */
-#ifdef DWARF2_DEBUGGING_INFO
-  if (write_symbols == DWARF2_DEBUG || write_symbols == VMS_AND_DWARF2_DEBUG)
+  if (DWARF2_DEBUGGING_INFO
+      && (write_symbols == DWARF2_DEBUG
+	  || write_symbols == VMS_AND_DWARF2_DEBUG))
     return UI_DWARF2;
-#endif
 
   return UI_NONE;
 }
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 15b8e54..b12571b 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -532,7 +532,7 @@  compile_file (void)
       /* Do dbx symbols.  */
       timevar_push (TV_SYMOUT);
 
-    #if defined DWARF2_DEBUGGING_INFO || defined DWARF2_UNWIND_INFO
+    #if DWARF2_DEBUGGING_INFO || defined DWARF2_UNWIND_INFO
       if (dwarf2out_do_frame ())
 	dwarf2out_frame_finish ();
     #endif
@@ -1376,10 +1376,8 @@  process_options (void)
     debug_hooks = &xcoff_debug_hooks;
   else if (SDB_DEBUGGING_INFO && write_symbols == SDB_DEBUG)
     debug_hooks = &sdb_debug_hooks;
-#ifdef DWARF2_DEBUGGING_INFO
-  else if (write_symbols == DWARF2_DEBUG)
+  else if (DWARF2_DEBUGGING_INFO && write_symbols == DWARF2_DEBUG)
     debug_hooks = &dwarf2_debug_hooks;
-#endif
   else if (VMS_DEBUGGING_INFO
 	   && (write_symbols == VMS_DEBUG
 	       || write_symbols == VMS_AND_DWARF2_DEBUG))