This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 08/12] always define DWARF2_LINENO_DEBUGGING_INFO


From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

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

	* defaults.h (DWARF2_LINENO_DEBUGGING_INFO): new default
	definition.
	* dwarf2out.c (dwarf2out_init): Adjust.
	* opts.c (set_debug_level): Likewise.
	* toplev.c (process_options): Likewise.
---
 gcc/defaults.h  | 6 +++++-
 gcc/dwarf2out.c | 4 ++--
 gcc/opts.c      | 9 ++++-----
 gcc/toplev.c    | 4 +---
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/gcc/defaults.h b/gcc/defaults.h
index d1728aa..65ffe59 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -926,6 +926,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define DWARF2_DEBUGGING_INFO 0
 #endif
 
+#ifndef DWARF2_LINENO_DEBUGGING_INFO
+#define DWARF2_LINENO_DEBUGGING_INFO 0
+#endif
+
 #ifndef XCOFF_DEBUGGING_INFO
 #define XCOFF_DEBUGGING_INFO 0
 #endif
@@ -952,7 +956,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #elif SDB_DEBUGGING_INFO
 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
 
-#elif DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
+#elif DWARF2_DEBUGGING_INFO || DWARF2_LINENO_DEBUGGING_INFO
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 
 #elif VMS_DEBUGGING_INFO
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index cb6acc6..2d94bc3 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -23257,7 +23257,7 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
   /* Allocate the file_table.  */
   file_table = hash_table<dwarf_file_hasher>::create_ggc (50);
 
-#ifndef DWARF2_LINENO_DEBUGGING_INFO
+#if !DWARF2_LINENO_DEBUGGING_INFO
   /* Allocate the decl_die_table.  */
   decl_die_table = hash_table<decl_die_hasher>::create_ggc (10);
 
@@ -23379,7 +23379,7 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
   text_section_line_info = new_line_info_table ();
   text_section_line_info->end_label = text_end_label;
 
-#ifdef DWARF2_LINENO_DEBUGGING_INFO
+#if DWARF2_LINENO_DEBUGGING_INFO
   cur_line_info_table = text_section_line_info;
 #endif
 
diff --git a/gcc/opts.c b/gcc/opts.c
index 0ed9ac6..1300a92 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -2287,11 +2287,10 @@ set_debug_level (enum debug_info_type type, int extended, const char *arg,
 
 	  if (extended == 2)
 	    {
-#if DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
-	      opts->x_write_symbols = DWARF2_DEBUG;
-#elif DBX_DEBUGGING_INFO
-	      opts->x_write_symbols = DBX_DEBUG;
-#endif
+	      if (DWARF2_DEBUGGING_INFO || DWARF2_LINENO_DEBUGGING_INFO)
+		opts->x_write_symbols = DWARF2_DEBUG;
+	      else if (DBX_DEBUGGING_INFO)
+		opts->x_write_symbols = DBX_DEBUG;
 	    }
 
 	  if (opts->x_write_symbols == NO_DEBUG)
diff --git a/gcc/toplev.c b/gcc/toplev.c
index d015f0f..f318a98 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1380,10 +1380,8 @@ process_options (void)
 	   && (write_symbols == VMS_DEBUG
 	       || write_symbols == VMS_AND_DWARF2_DEBUG))
     debug_hooks = &vmsdbg_debug_hooks;
-#ifdef DWARF2_LINENO_DEBUGGING_INFO
-  else if (write_symbols == DWARF2_DEBUG)
+  else if (DWARF2_LINENO_DEBUGGING_INFO && write_symbols == DWARF2_DEBUG)
     debug_hooks = &dwarf2_lineno_debug_hooks;
-#endif
   else
     error ("target system does not support the %qs debug format",
 	   debug_type_names[write_symbols]);
-- 
2.5.0.rc1.5.gc07173f


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]